1

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];
halfer
  • 19,824
  • 17
  • 99
  • 186
pinku
  • 57
  • 2
  • 10

1 Answers1

5


you are not adding textfield in cell but adding in UIView.

[cell.contentView addSubview:companyName];
dks1725
  • 1,631
  • 1
  • 20
  • 29
  • why the answer is not accepted? it worked for me. the modification i done is `companyName = [[UITextField alloc]initWithFrame:CGRectMake(190, 6, 90, 31)];` and `companyName.borderStyle =UITextBorderStyleRoundedRect;` – Soorej Babu Jun 05 '16 at 13:02