【发布时间】:2012-09-05 22:50:53
【问题描述】:
在我当前的 iOS 项目中,我向 tableView 添加了一个带有标签和文本字段的动态单元格。我正在使用以下代码来制作 textField:
UITextField *inputField;
inputField = [[UITextField alloc] initWithFrame:CGRectMake(120,12,185,30)];
inputField.textAlignment = UITextAlignmentRight;
inputField.adjustsFontSizeToFitWidth = YES;
inputField.placeholder = @"your text here...";
[cell addSubview:inputField];
结果如下所示:
我的问题是如何设置代码生成的文本字段的样式,使其看起来像常规的 IB 文本字段?
【问题讨论】:
标签: iphone objective-c xcode cocoa-touch uitextfield