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?
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.
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.
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.
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...
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With