iOS 5 获取 alertView 上的 TextField

UIAlertView *alertview = [[UIAlertView alloc]initWithTitle:NSLocalizedString(@"活动费用(元/人)", nil) message:nil delegate:self cancelButtonTitle:NSLocalizedString(@"取消", nil) otherButtonTitles:NSLocalizedString(@"确定", nil), nil];

alertview.alertViewStyle = UIAlertViewStylePlainTextInput;

UITextField *textFiled = [alertview textFieldAtIndex:0];

textFiled.keyboardType = UIKeyboardTypeNumberPad;

textFiled.placeholder = NSLocalizedString(@"请输入活动费用(元/人)", nil);

[alertview show];

你可能感兴趣的:(iOS 5 获取 alertView 上的 TextField)