ios alertView添加输入框
初始化UIAlertView后
设置 alertView 的alertViewStyle
UIAlertViewStylePlainTextInput 添加一个普通输入框
UIAlertViewStyleSecureTextInput 密码输入框
UIAlertViewStyleLoginAndPasswordInput 普通输入框加密码输入框
加一句
[alert addTextFieldWithValue:@"" label:@""]; 注:这个方法已经被列为私有API,不可用了
[alert show];
然后在
-(void)alertView : (UIAlertView*)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
//得到输入框
UITextField *tf=[alertView textFieldAtIndex:0];
[alertView release];
}