iOS: 在键盘之上显示一个 View

来源:互联网 发布:js正则过滤表情符号 编辑:程序博客网 时间:2024/05/16 12:41
UIWindow *window = [[[UIApplication sharedApplication] windows] lastObject];[window addSubview:view];如 AlertView,当 show 一个 Alert 时,它会覆盖在 Keyboard 上面,不影响显示的效果。那么我们自己创建的 View 如何像 Alert 那样不被键盘盖住呢?很简单,拿到 Application 的 最上面一个 window,把 View 加到这个 window 上,就可以了。
0 0