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 .
source share