Ash*_*osh 4 iphone uitextfield
我试图通过IB增加我的应用程序中的UITextField的高度.我已经在我的IB中定义了这些文本字段,所以我认为它需要通过IB来完成.如果有办法通过IB或代码,请告诉我.
谢谢,
作为UITextField的子类UIView,它继承了UIView的initWithFrame方法.
NSInteger myCustomHeight = 237;
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(10, 10, 200, myCustomHeight)];
Run Code Online (Sandbox Code Playgroud)
如果您想通过IB执行此操作,请将最后一行替换为:
textField.frame = CGRectMake(10, 10, 200, myCustomHeight);
Run Code Online (Sandbox Code Playgroud)
这假定textField是一个IBOutlet.
| 归档时间: |
|
| 查看次数: |
2801 次 |
| 最近记录: |