I am trying to increase the height of the UITextField in my app through IB. I have defined these textfield in my IB so i think it needs to be done through IB. Please let me know if there is a way to do it either through IB or through code.
Thanks,
As UITextField subclasses UIView, it inherits UIView's initWithFrame
method.
NSInteger myCustomHeight = 237;
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(10, 10, 200, myCustomHeight)];
If u want do do it through IB then replace the last line with:
textField.frame = CGRectMake(10, 10, 200, myCustomHeight);
This assumes textField is an IBOutlet
.
Increasing the height of UITextField is possible. But you cannot get text on next line, you can write text on only one line. It you want to have Textfield look alike you can use UITextView with editing option where you can increase the height and can have text on multiple lines.
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