开发者

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section?

If i needed more rows in one section than another, is ther开发者_如何转开发e a code i could implement to do this?

I have 3 sections altogether but in one section i require 6 rows, in another only 3, and in the last perhaps 3 again.

Regards, Jon


You just implement the method in the title that returns a different number for different section.

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
   if (section == 0)
     return 6;
   else
     return 3;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜