首页 > 移动平台 > 详细

iOS中TableView的使用

时间:2015-12-27 19:04:06      阅读:229      评论:0      收藏:0      [点我收藏+]

1.在ViewController中添加TableView

  stroyboard或者code添加

2.在ViewController.m中加入<UITableViewDataSource>协议 或

   在其他类中添加此协议

3.在ViewController.m中使此TableView的数据源为本身 或

   其他类

4.添加

   (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView //返回组数

   (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section //返回每组的cell数

 (NSString*)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section //返回每个组的组名

   (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath //返回cell

   等方法

iOS中TableView的使用

原文:http://www.cnblogs.com/Thkeer/p/5080558.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!