Is there a way to increase the height of the text box besides increasing the font size

I am trying to increase the height of a UITextField in my application through IB. I defined this text box in my IB, so I think it needs to be done through IB. Please let me know if there is a way to do this through IB or via code.

Thanks,

+4
source share
2 answers

As a subclass of UITextField UIView, it inherits the UIView initWithFrame .

 NSInteger myCustomHeight = 237; UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(10, 10, 200, myCustomHeight)]; 

If you want to do this via IB, replace the last line as follows:

 textField.frame = CGRectMake(10, 10, 200, myCustomHeight); 

It is assumed that textField is an IBOutlet .

+7
source

Possible increase in height of UITextField. But you cannot get text on the next line, you can write text on only one line. You want the Textfield to look the same, you can use the editable UITextView, where you can increase the height and have text on multiple lines.

+2
source

Source: https://habr.com/ru/post/1347120/


All Articles