封装好的类似于AssistiveTouch的漂浮按钮
这个是飘窗的高度封装,只需要在- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions函数中调用一个方法,即可实现飘窗,并采用block回调,方便点击按钮后自定义弹框,可以将自定义弹框放到window上实现自己的方法。用起来简单,粗暴eg: //添加按钮UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 50, 50)]; view.backgroundColor = [UIColor redColor]; UIView *blue = [[UIView alloc] initWithFrame:CGRectMake(0, 50, 50)]; blue.backgroundColor = [UIColor blackColor]; [HMYAssistiveControl createOnMainWindowWithCollapsedView:view andExpandedView:nil andBlockClickData:^(CGPoint pointTouch){ NSLog(@"click me is block!~ ha,在这类写出你要的弹框效果即可= %@",NSStringFromCGPoint(pointTouch)); } andIsStickyEdge:YES]; //如果是YES就是自动贴近边沿如果是NO则只是拖到哪就是哪哈哈~方便
88.68KB
文件大小:
评论区