How to change height of text field?

2019-03-14 11:17发布

Is there a way to change the height of a text field in IB?

If not, what is the proper way to do it in code?

3条回答
我想做一个坏孩纸
2楼-- · 2019-03-14 11:28

In the attribute inspector of your textField you can select the first, second and third Border Styles to increase the height.

查看更多
成全新的幸福
3楼-- · 2019-03-14 11:33

Click the attribute inspector for the textField and then change the Border style to second one and you will be able to change the height.

enter image description here

查看更多
家丑人穷心不美
4楼-- · 2019-03-14 11:42

Step 1 : Click the Attribute Inspector, Select the Border Styles which is not the rounded one.

borderstyle

Step 2 : Now go to Size Inspector and change the size of the TextField.

change the height of the textfield

Step 3 : Create an @IBOutlet for TextField and then add below code inside the viewWillAppear() or viewDidAppear().

userTextField.borderStyle = UITextBorderStyle.roundedRect

Now you'll get the cool rounded textfield.

查看更多
登录 后发表回答