user837744
user837744

Reputation: 41

Increasing height of UITextField?

I tried this:

UITextField *field = [[UITextField alloc] initWithFrame:CGRectMake(164, 282, 461, 60)];
[txt setBorderStyle:UITextBorderStyleRoundedRect];

But when I build I cannot see the UITextField, help please. I also tried, field = CGSizeMake but you cannot assign CGSizeMake to a UITextField

Upvotes: 0

Views: 574

Answers (3)

Pritesh
Pritesh

Reputation: 980

i think you should try this too

first give constrain to text field as below

enter image description here

and now simply increase the height of text filed

enter image description here

and if you don't want constrain then remove it

enter image description here

i hope it will help you

Upvotes: 0

Rahul Vyas
Rahul Vyas

Reputation: 28720

you forget to add textfield as subview. Use

[self.view addSubView:field];

Upvotes: 3

Jhaliya - Praveen Sharma
Jhaliya - Praveen Sharma

Reputation: 31722

Add it as subView in your main view. using addSubview: method of UIView.

Like below.

[self.view addSubview:field];

Upvotes: 1

Related Questions