资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

IOSUITableView表格视图详解

IOS 表格视图类UITableView

成都创新互联是一家专业的成都网站建设公司,我们专注成都网站设计、成都网站制作、外贸网站建设、网络营销、企业网站建设,买友情链接广告投放平台为企业客户提供一站式建站解决方案,能带给客户新的互联网理念。从网站结构的规划UI设计到用户体验提高,创新互联力求做到尽善尽美。

实现的协议:UITableViewDataSource,UITableViewDelegate

必须实现下面的3个方法:

self.tableView.separatorStyle=UITableViewCellSeparatorStyleSingleLine;  

- (NSInteger)numberOfSectionsInTableView:(UITableView*)tableView {

  return 1;

}

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

  return 3;

}

- (UITableViewCell*)tableView:(UITableView*)tableView

  cellForRowAtIndexPath:(NSIndexPath*)indexPath

{

    

    //使单元格右侧显示一个箭头

   cell.accessoryType =UITableViewCellAccessoryDisclosureIndicator;

    cell.selectionStyle =UITableViewCellSelectionStyleNone; 


}

可选的方法:

- (void)tableView:(UITableView*)tableView

  didSelectRowAtIndexPath:(NSIndexPath*)indexPath

{

}

- (BOOL)tableView:(UITableView*)tableView canEditRowAtIndexPath:(NSIndexPath*)indexPath {

  return ( 1 == indexPath.section );

}

- (NSString*)tableView:(UITableView*)tableView titleForHeaderInSection:(NSInteger)section {

  return @"标题";

}

- (void)tableView:(UITableView*)tableView willBeginEditingRowAtIndexPath:(NSIndexPath*)indexPath {

}

- (void)tableView:(UITableView*)tableView didEndEditingRowAtIndexPath:(NSIndexPath*)indexPath {

}

- (void)tableView:(UITableView*)tableView

  commitEditingStyle:(UITableViewCellEditingStyle)editingStyle

   forRowAtIndexPath:(NSIndexPath*)indexPath

{

  if ( UITableViewCellEditingStyleDelete == editingStyle ) {

  }

}


分享文章:IOSUITableView表格视图详解
转载来源:http://cdkjz.cn/article/jhejsh.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220