_无事莫登旧人梦 2015-10-29 16:00 采纳率: 0%
浏览 1688

ios UIAlertView 自带的UITextField为什么这么窄?

如题,哪位知道请帮忙解惑,急!急!急!图片说明

  • 写回答

4条回答 默认 最新

  • _无事莫登旧人梦 2015-10-29 16:05
    关注

    附上源码

    • (void)buidl
      {
      UIAlertView *customAlertView = [[[UIAlertView alloc] initWithTitle:@"自定义服务器地址" message:nil delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil] autorelease];
      [customAlertView setAlertViewStyle:UIAlertViewStyleLoginAndPasswordInput];

      UITextField *nameField = [customAlertView textFieldAtIndex:0];
      nameField.placeholder = @"请输入一个名称";

      UITextField *urlField = [customAlertView textFieldAtIndex:1];
      [urlField setSecureTextEntry:NO];
      urlField.placeholder = @"请输入一个URL";
      urlField.text = @"http://";

      [customAlertView show];
      }

    评论

报告相同问题?