UIAlertView的基本用法

来源:互联网 发布:怎么申请成为淘宝达人 编辑:程序博客网 时间:2024/06/05 06:49

     UIAlertView *alert = [[UIAlertViewalloc]initWithTitle:@"修改昵称"message:nildelegate:selfcancelButtonTitle:@"取消"otherButtonTitles:@"确定",nil];

        alert.alertViewStyle =UIAlertViewStylePlainTextInput;

       UITextField *textField = [alerttextFieldAtIndex:0];

        textField.textColor =WordDeepColor;

        textField.font = [UIFontsystemFontOfSize:14];

        textField.placeholder =@"请输入昵称";

        [alertshow];


- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{

   if (buttonIndex ==1) {

       UITextField *textField = [alertViewtextFieldAtIndex:0];

       self.user.nick = textField.text;

        [selfchangeUserInfoHasHeadImage:NO];

    }

}









0 0
原创粉丝点击