iPhone上获取用户输入的方法

发布于 2024-10-05 11:15:32 字数 229 浏览 3 评论 0原文

我正在开发一个 iPhone 应用程序,希望在用户单击我的自定义搜索按钮时弹出一个简单的文本输入框。我的问题是我不确定有哪些方法可以实现这一目标。谷歌搜索导致搜索过载,我看到了太多的观点,以至于我不确定什么是标准的,什么不是。我向用户请求的信息是一个邮政编码,因此如果可能的话,我希望避免为此创建一个全新的视图。我对 Xcode 工作还是个新手,所以请放轻松。

编辑:iTunes 用来询问您密码的对话框是理想的选择。那叫什么?

I'm working on an iPhone app and would like to have a simple text input box pop up when a user clicks my custom search button. My problem is that I'm not sure what approaches are available for achieving this. Googling results in search overload and I am presented with so many views that I'm not sure what is standard and what isn't. The information I am requesting from the user is a single zip code so I would like to avoid creating a whole new view for this if possible. I am still new to working in Xcode so please take it easy on me.

Edit: The dialog box that iTunes uses to ask for your password would be ideal. What is that called?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

风苍溪 2024-10-12 11:15:32

好吧,您可以使用包含 UITextView 的 UIAlertView。

老实说,我不确定苹果会喜欢它,因为 UIAlertView 应该只提示消息来通知用户,但它至少有点酷;)

你可以在这个网站上找到一个教程:http://iphonedevelopment.blogspot.com/2009/02/alert-view-with-prompt.html

Well, you could use a UIAlertView including a UITextView.

Honestly, I'm not sure Apple will like it, because UIAlertView should only prompt message to inform the user, but it's at least kinda cool ;)

You can find a tutorial on this website : http://iphonedevelopment.blogspot.com/2009/02/alert-view-with-prompt.html

末骤雨初歇 2024-10-12 11:15:32

使用

[alert setAlertViewStyle:UIAlertViewStylePlainTextInput];

[alert setAlertViewStyle:UIAlertViewStyleLoginAndPasswordInput];

希望有帮助!祝你好运

Use

[alert setAlertViewStyle:UIAlertViewStylePlainTextInput];

or

[alert setAlertViewStyle:UIAlertViewStyleLoginAndPasswordInput];

Hope it helps! Best of luck

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