程序员iOS DeveloperiOS 开发每天分享优质文章

OC_UIAlertView添加UITextField

2016-05-16  本文已影响661人  KermitX
效果图
    UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:@"请输入对方付款码"
                                                         message:nil delegate:self
                                               cancelButtonTitle:@"取消"
                                               otherButtonTitles:@"收款", nil];
/*
UIAlertViewStyle
    UIAlertViewStyleDefault = 0,
    UIAlertViewStyleSecureTextInput,
    UIAlertViewStylePlainTextInput,
    UIAlertViewStyleLoginAndPasswordInput
*/
    [alertView setAlertViewStyle:UIAlertViewStylePlainTextInput];
    
    _textField = [alertView textFieldAtIndex:0];
    _textField.placeholder = @"18位付款码 在条形码下方";
    _textField.keyboardType = UIKeyboardTypeNumberPad;
    
    [alertView show];
上一篇 下一篇

猜你喜欢

热点阅读