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