Reputation: 39
In storyBoard,there are two type cells.One is Dynamic prototype.The other is static Cells.But when I want build a tableViewController without storyboard,How to creat static cells with code? Thanks a lot.
Upvotes: 0
Views: 36
Reputation: 7963
Please refer this this code.
It explain Create a static UITableView without Storyboards.
Upvotes: 1
Reputation: 39
I search some similar questions.If we write a static UITableViewController with code. Maybe we don`t have to use UITableView. Instead we can use UIScrollview and some other UIControls.
Upvotes: 0
Reputation: 1488
Just create it in your viewdidload
UITableView *tblView =[UITableView alloc]initWithFrame:self.view.frame style:UITableViewStylePlain]];
and in the cellForRowAtIndexPath
method
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"identifier" forIndexPath:indexPath];
If you do this you dont need to configure it in the storyboard.
Upvotes: 0