iPhone - 暂时禁用键盘
G'day All
我的应用程序有一个首次运行的组件,它显示登录/注册屏幕和屏幕。成功登录/注册后,将继续加载应用程序的数据。对于那些看过它的人来说,这个过程遵循与 Instagram 类似的风格。如果输入密码时键盘消失有一个错误,一旦消失就会弹出,这让我觉得不太好看。那么,有没有什么方法可以在应用程序发送用户凭据和密码时禁用键盘或阻止用户交互,而无需实际关闭它。等待回应?
干杯&蒂亚,佩德罗:)
G'day All
My app has a first run component that presents a login/signup screen & on successful login/signup moves on to loading the app's data. For those who've seen it the process follows similar style to that in Instagram. If the keyboard is dismissed on entering the password & there's an error it pops back up as soon as it's gone which strikes me as not being a great look. So is there any way to disable the keyboard or prevent user interaction without actually dismissing it while the app sends the user credentials & waits for a response?
Cheers & TIA, Pedro :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
第一次关闭后,我将 UITextField 设置为禁用。不再可能进行用户交互,并且键盘不应再弹出。这也将带来很好的灰色用户界面体验。
此外,您应该有一个 TextFieldDelegate 1 实现
textFieldShouldBeginEditing:
并返回NO;
。这将导致键盘不出现。After the first dismiss, I would set the UITextField as disabled. No user Interaction is possible anymore and the keyboard shouldn't pop up anymore. This will also have the nice UI touch of being greyed out.
Additionally, you should have a TextFieldDelegate 1 implement
textFieldShouldBeginEditing:
andreturn NO;
. That will cause the keyboard to not appear.