UIAlertController-更改文本字段的大小并在它们之间添加空间 [英] UIAlertController - change size of text fields and add space between them

查看:115
本文介绍了UIAlertController-更改文本字段的大小并在它们之间添加空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的警报如下:

是否可以增大输入并在它们之间增加空间?这是我的代码片段.我尝试更改第二个文本字段的frame属性,但没有帮助:

Is it possible to make inputs bigger and add space between them? Here is a snippet from my code. I tried changing the frame property of the second text field but it didn't help:

let alert = UIAlertController(title: title, message: message, preferredStyle: .Alert)

// Add the textfields
alert.addTextFieldWithConfigurationHandler({ (textField) -> Void in
  textField.placeholder = "Vaše jméno"

})

alert.addTextFieldWithConfigurationHandler({ (textField) -> Void in
  textField.placeholder = "Společné heslo"

  var oldFrame = textField.frame
  oldFrame.origin.y = 40
  oldFrame.size.height = 60
  textField.frame = oldFrame
})

推荐答案

UIAlertController视图旨在简单且不可自定义.如果您自己创建呈现的视图控制器,则该视图属于您,您可以做任何喜欢的事情.

UIAlertController views are intended to be simple and not customizable. If you make your own presented view controller, then the view belongs to you and you can do anything you like.

这篇关于UIAlertController-更改文本字段的大小并在它们之间添加空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆