PLVFloatWindowManager
Objective-C
@interface PLVFloatWindowManager : NSObject
Swift
class PLVFloatWindowManager : NSObject
浮窗管理器,负责在悬浮窗上显示webView,以及关闭悬浮窗
-
Undocumented
Declaration
Objective-C
@property (nonatomic, readonly) BOOL showingFloatingWindowSwift
var showingFloatingWindow: Bool { get } -
Undocumented
Declaration
Objective-C
@property (nonatomic, readonly) CGSize defaultWindowSizeSwift
var defaultWindowSize: CGSize { get } -
Undocumented
Declaration
Objective-C
@property (nonatomic, strong, readonly) UIView *floatingWindow -
Undocumented
Declaration
Objective-C
@property (nonatomic, strong, readonly) UIView *contentView -
浮窗视图内容所在控制器页面(还原时需要用到),注意退出时进行销毁
Declaration
Objective-C
@property (nonatomic, strong, nullable) UIViewController *viewController -
小窗 支持的旋转方向
Declaration
Objective-C
@property (nonatomic) int supportedInterfaceOrientations;Swift
var supportedInterfaceOrientations: Int32 { get set } -
浮窗管理器单例
Declaration
Objective-C
+ (nonnull instancetype)sharedManager;Swift
class func shared() -> Self -
设置悬浮窗大小,宽高均应为正数,如不设置或参数不规范,则使用默认值
Note
如不设置或参数不规范,主动唤出浮窗时浮窗宽度为屏幕的0.3倍,宽高比16:9,js唤出浮窗时以h5告知的宽高为准Declaration
Objective-C
- (void)setFloatingWindowSize:(CGSize)size;Swift
func setFloatingWindowSize(_ size: CGSize)Parameters
size悬浮窗的宽高,
-
设置悬浮窗位置,如不设置则使用默认值
Declaration
Objective-C
- (void)setFloatingWindowLocation:(CGPoint)point;Swift
func setFloatingWindowLocation(_ point: CGPoint)Parameters
point悬浮窗右下角距离屏幕右下角的相对位置,默认为(-10, -100), 表示悬浮窗右边沿距离屏幕右边沿10pt,下边沿距离屏幕下边沿100pt
-
把 view 移到浮窗,浮窗大小使用外部设置的值,如无设置,使用参数size的值,size宽高为0,使用默认值 浮窗默认宽度为屏幕的0.3倍,宽高比16:9
Declaration
Objective-C
- (void)moveContentViewToWindow:(id)contentView size:(CGSize)size;Swift
func moveContentView(toWindow contentView: Any!, size: CGSize) -
关闭浮窗
Declaration
Objective-C
- (void)closeWindow;Swift
func closeWindow()
View on GitHub
PLVFloatWindowManager Class Reference