iPhone - 暂时禁用键盘

发布于 2024-10-07 07:53:48 字数 227 浏览 0 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

初吻给了烟 2024-10-14 07:53:48

第一次关闭后,我将 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: and return NO;. That will cause the keyboard to not appear.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文