pinku
pinku

Reputation: 57

How to add textfield in uitableviewcell

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];

Upvotes: 1

Views: 2772

Answers (1)

dks1725
dks1725

Reputation: 1631


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

[cell.contentView addSubview:companyName];

Upvotes: 5

Related Questions