gpt4 book ai didi

iphone - 如何将多个 UITextFields 添加到 iOS 7 中的 UIAlertView?

转载 作者:可可西里 更新时间:2023-11-01 06:23:19 25 4
gpt4 key购买 nike

我需要在 iOS 7 的 UIAlertView 上添加多个 UITextField?

 myAlertView = [[UIAlertView alloc] initWithTitle:@"Enter Your Detail" message:@"\n\n\n\n\n" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Register",nil];
txtEmail = [[UITextField alloc] initWithFrame:CGRectMake(30, 40, 220, 25)];
txtEmail.placeholder = @"email address";
txtFirstName = [[UITextField alloc] initWithFrame:CGRectMake(30, 70, 220, 25)];
txtFirstName.placeholder = @"first Name";
txtSurname = [[UITextField alloc] initWithFrame:CGRectMake(30, 100, 220, 25)];
txtSurname.placeholder = @"surname";
[myAlertView addSubview:txtEmail];
[myAlertView addSubview:txtFirstName];
[myAlertView addSubview:txtSurname];

[myAlertView show];

在 IOS 6 中没问题,但在 IOS 7 中它不显示 UITextField

最佳答案

你不能再这样做了,在 iOS7 中不再有 UIAlertViewaddSubview

以下是不错的选择:

ios-custom-alertview

MZFormSheetController

关于iphone - 如何将多个 UITextFields 添加到 iOS 7 中的 UIAlertView?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19090547/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com