如何将 UIAlertView 保持在键盘上方?它只会跳起来然后返回默认值
我创建了一个包含 iPad 文本字段的 uiAlertView。这意味着在横向模式下,警报会被键盘掩盖。我搜索了一个解决方案,然后想出了
alert.transform = CGAffineTransformTranslate(alert.transform, 0.0, 150.0);
然而,这一切似乎都是使警报“跳”到 150,然后回到默认位置。如何让警报保持在高位而不跳回?
谢谢!
I created a uiAlertView that contains textFields for an iPad. This means that in landscape mode, the alert is covered up by the keyboard. I searched for a solution and I came up with
alert.transform = CGAffineTransformTranslate(alert.transform, 0.0, 150.0);
However, all this seems to do is make the alert "jump" up to 150 and then come back down to its default place. How can I make the alert stay up high without jumping back down?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将文本字段的
keyboardAppearance
设置为UIKeyboardAppearanceAlert
。将文本字段放在 UIAlertView 上还有一些其他技巧。请参阅我关于该主题的博客文章。
You can set the text field's
keyboardAppearance
toUIKeyboardAppearanceAlert
.There are a few other tricks to putting textfields on UIAlertView. See my blog post on the subject.