Fahim Parkar Fahim Parkar - 1 year ago 98
Objective-C Question

custom height for rounded rectangle UITextField

I have UITextField of type RoundedRectangle. I want to set height to 50.

When I tried through IB, I see its disabled. When I change the type to rectangle, I see it enabled and I can change from there. I changed to 50 and changed the type again to RoundedRectangle. It again become, 30 height.

Any idea, how this can be done? Any help/ suggestions would be appreciated.

Answer Source

Set the textfield type to square rectangle in IB and set height to 50 and in code in viewDidLoad just say

[firstName setBorderStyle:UITextBorderStyleRoundedRect];
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download