这是调用下面showUIwindow的方法,
<span style="font-size:18px;"> [self performSelector:@selector(showuiwindow) withObject:nil afterDelay:0];
}
-(void)showuiwindow{
self.keyWindow = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, APPLICATION_WIDTH, 20)];
self.keyWindow.windowLevel=UIWindowLevelStatusBar+1;
// self.keyWindow.frame=[UIApplication sharedApplication].statusBarFrame;
self.keyWindow.backgroundColor=[UIColor clearColor];
// UITapGestureRecognizer *tap=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(backtoTop:)];
// [keyWindow addGestureRecognizer:tap];
self.topbtn=[[UIButton alloc]initWithFrame:self.keyWindow.frame];
self.topbtn.backgroundColor=[UIColor clearColor];
[self.keyWindow addSubview:self.topbtn];
[self.topbtn addTarget:self action:@selector(totop:) forControlEvents:UIControlEventTouchUpInside];
[self.keyWindow makeKeyAndVisible];
}
</span>
在界面建一个悬浮的框类似苹果自己的悬浮框
最新推荐文章于 2021-09-06 16:24:01 发布