UIAlertview上的iOS多个文本字段在IOS 7中 [英] iOS multiple text fields on a UIAlertview In IOS 7
问题描述
所以新的iOS 7已经问世了,我正在尝试为UIAlertviews添加多个textFields和标签。我需要三个。我一直在尝试将它们添加为子视图,这不再适用。我还尝试使用UIAlertViewStylePlainTextInput添加多行,但它似乎只返回一个文本字段。
So the new iOS 7 has come out and I'm trying to add multiple textFields and labels to the UIAlertviews. I need three. I've been trying to add them as subviews and that doesn't work anymore. I have also tried to add multiple lines with the UIAlertViewStylePlainTextInput but it only seems to return one text field.
我需要添加标签以向他们展示输入内容。有没有办法用新的iOS 7完成这项任务?
I need to add in labels to show them what to enter as well. Is there a way to accomplish this task with the new iOS 7?
推荐答案
我发现使用UIAlertView的唯一解决方案iOS7中的文本字段仅用于登录。
The only solution i found using UIAlertView with more than one text field in iOS7 is for login only.
使用此行初始化alertView
use this line to initialize your alertView
[alert setAlertViewStyle:UIAlertViewStyleLoginAndPasswordInput];
这是为了获取用户输入:
and this to grab the users input:
user = [alert textFieldAtIndex:0].text;
pw = [alert textFieldAtIndex:1].text
除登录视图以外的其他用途像这样的其他线程: iOS7中的UIAlertView addSubview
For other purposes than login view the other threads like this on: UIAlertView addSubview in iOS7
这篇关于UIAlertview上的iOS多个文本字段在IOS 7中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!