如何在UIAlertController中设置两个UITextField之间的距离?

时间:2016-08-19 09:12:57

标签: ios objective-c uialertview

我正在使用UIAlertController来展示包含两个UITextField的对话框。如何在UIAlertController中设置TextFields的距离?

[alertController addTextFieldWithConfigurationHandler:
        ^(UITextField *textField) {
      textField.placeholder = @"Nick Email";
      textField.textColor = [UIColor blueColor];
      textField.clearButtonMode = UITextFieldViewModeWhileEditing;
      textField.text=username;
      textField.userInteractionEnabled = NO;}];
[alertController addTextFieldWithConfigurationHandler:^(UITextField *textField) {

  textField.placeholder = @"Full Name";
  [textField setKeyboardType : UIKeyboardTypeEmailAddress];
  textField.textColor = [UIColor blueColor];
  textField.clearButtonMode = UITextFieldViewModeWhileEditing;

  textField.text=email;
  textField.userInteractionEnabled = NO;

}];

screenshot

1 个答案:

答案 0 :(得分:5)

UIAlertController 视图很简单,无法自定义。如果你需要,那么添加自定义UIView或现有的模态控制器,或者然后去任何第三方