美文网首页每日一点
iOS 5 获取 alertView 上的 TextField

iOS 5 获取 alertView 上的 TextField

作者: PPFSaber | 来源:发表于2017-07-12 19:45 被阅读5次

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

    本文链接:https://www.haomeiwen.com/subject/ebfihxtx.html