效果图:
代码:
//点击任何处,弹出输入框 -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ UIAlertView *dialog = [[UIAlertView alloc] initWithTitle:@"请输入分组名称" message:@"\n" delegate:self cancelButtonTitle:@"添加" otherButtonTitles:@"取消",nil]; [dialog setAlertViewStyle:UIAlertViewStylePlainTextInput]; [[dialog textFieldAtIndex:0] setKeyboardType:UIKeyboardTypeNumberPad]; [dialog show]; }