如何在uitableviewcell中添加文本字段
我有一个表格视图,其中有一行和一个部分,表格视图的行高为 300,并且行有一张覆盖整行的图像。我想添加三个文本字段和一个按钮;我正在添加文本字段,该文本字段已正确添加但未显示。
我添加 cellforrowAtIndexPath 代码是:
companyName = [[UITextField alloc]initWithFrame:CGRectMake(33, 6, 259, 31)];
companyName.textColor = [UIColor BlackColor];
companyName.delegate =self;
companyName.textAlignment = UITextAlignmentCenter;
companyName.highlighted = YES;
[self.view addSubview:companyName];
I have one tableview which are having one row and one section and the row height of tableview 300, and row have an image which covers whole row. I want to add three textfield and one button; I am adding textfield which are add properly but does not show.
I am adding cellforrowAtIndexPath code is:
companyName = [[UITextField alloc]initWithFrame:CGRectMake(33, 6, 259, 31)];
companyName.textColor = [UIColor BlackColor];
companyName.delegate =self;
companyName.textAlignment = UITextAlignmentCenter;
companyName.highlighted = YES;
[self.view addSubview:companyName];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不是在单元格中添加文本字段,而是在 UIView 中添加。
you are not adding textfield in cell but adding in UIView.