Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change height of text field?

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?

like image 800
4thSpace Avatar asked May 08 '16 05:05

4thSpace


People also ask

How do I change the height of my TextField?

To change the TextField height by changing the Font Size: Step 1: Inside the TextField, Add the style parameter and assign the TextStyle(). Step 2: Inside the TextStyle(), Add the fontSize parameter and set the appropriate value. Step 3: Run the app.

How do I change the TextField height in material UI?

Another method for setting Material-UI TextField width and height is a combination of sx at the TextField root and passing sx styling values to the composing Input component via InputProps . The width is set with TextField prop sx={{width: 300}} . The height is set by passing sx: { height: 80 } to the InputProps prop.

How do I change the size of a TextField in Xcode?

Step 1 : Click the Attribute Inspector, Select the Border Styles which is not the rounded one. Step 2 : Now go to Size Inspector and change the size of the TextField.

How do you change the input height of text in CSS?

You can try line-height (may need display:block; or display:inline-block; ) or top and bottom padding also. If none of those work, that's pretty much it - use a graphic, position the input in the center and set border:none; so it looks like the form control is big but it actually isn't...


2 Answers

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

like image 189
Rashwan L Avatar answered Sep 28 '22 00:09

Rashwan L


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 

Swift 4.2

userTextField.borderStyle = UITextField.BorderStyle.roundedRect 

Now you'll get the cool rounded textfield.

like image 44
Vinoth Vino Avatar answered Sep 27 '22 22:09

Vinoth Vino