简体   繁体   中英

How to increase UITextField height in iphone

I'm creating UITextField using Xib . That default height is 30. But I want to increase that text field height to 40. Here I had created the outlet and mapped to files owner, then I wrote below line of code.

[textfield setFrame:CGRectMake(100, 200, 400, 100)];

But The height and width are also not changing as per my coding.

Thanks in Advanced.

You need to follow only one step & you will have your solution.

Checkout this image

从文本域属性边框样式中选择第一个选项

Enjoy Programming !!

CGRect frameRect = textField.frame;
frameRect.size.height = 100(specify the height you want);
textField.frame = frameRect;

set BorderStyle to None like bellow

[textfield setBorderStyle:UITextBorderStyleNone];

and after set frame..

here if your textfield's style is bezier then its frame is fixed and this is the problem so change it with above line

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM