如何在iOS 7中将多个UITextField添加到UIAlertView? [英] How to add multiple UITextFields to a UIAlertView in iOS 7?

查看:57
本文介绍了如何在iOS 7中将多个UITextField添加到UIAlertView?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I need to add Multiple UITextField on a UIAlertView in iOS 7?

 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

in IOS 6 no problem but in IOS 7 it not show UITextField

推荐答案

您无法再执行此操作,iOS7中UIAlertViewaddSubview也不再存在.

You can't do this any more, there is no addSubview for UIAlertView any more in iOS7.

以下是不错的选择:

ios-custom-alertview

MZFormSheetController

这篇关于如何在iOS 7中将多个UITextField添加到UIAlertView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆