UIAlertView *prompt = [[UIAlertView alloc] initWithTitle:@"请输入起点:"
message:@"\n\n"
delegate:nil
cancelButtonTitle:@"取消"
otherButtonTitles:@"确定", nil];
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(27.0, 60.0, 230.0, 25.0)];
[textField setBackgroundColor:[UIColor whiteColor]];
[textField setPlaceholder:@"起点"];
[prompt addSubview:textField];
[textField release];
[prompt setTransform:CGAffineTransformMakeTranslation(0.0, -100.0)]; //可以调整弹出框在屏幕上的位置
[prompt show];
[prompt release];
本文介绍如何使用UIAlertView创建自定义输入框,包括设置标题、消息、按钮及添加UITextField等步骤,为用户提供一个简单的输入界面。
5787

被折叠的 条评论
为什么被折叠?



