ios实现带有输入框的AlertView


1,实现一个alertView

1     UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"" message:@"请输入Wi-Fi密码" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
2     alertView.alertViewStyle = UIAlertViewStyleSecureTextInput;
3     [alertView show];

2,实现代理方法

1 #pragma mark - UIAlertViewDelegate
2 - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
3     UITextField *passwordText = [alertView textFieldAtIndex:0];
4 //    passwordText.
5     NSLog(@"%@",passwordText.text);
6     NSLog(@"buttonIndex:%d",buttonIndex);
7 }

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM