开发者

Increasing height of UITextField?

开发者 https://www.devze.com 2023-03-19 08:46 出处:网络
I tried this: UITextField *field = [[UITextField alloc] initWithFrame:CGRectMake(164, 282, 461, 60)]; [txt setBorderStyle:UITextBorderStyleRoundedRect];

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


you forget to add textfield as subview. Use

[self.view addSubView:field];


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

Like below.

[self.view addSubview:field];


i think you should try this too

first give constrain to text field as below

Increasing height of UITextField?

and now simply increase the height of text filed

Increasing height of UITextField?

and if you don't want constrain then remove it

Increasing height of UITextField?

i hope it will help you

0

精彩评论

暂无评论...
验证码 换一张
取 消