tableview 显示主副标题的样式
来源:互联网 发布:恒腾网络 股吧 编辑:程序博客网 时间:2024/04/30 05:29
tableview的显示的样式主要是在于这几种:
我要重点介绍的是第四种---在一个cell里面分行显示数据(相当于主标题和副标题)
typedefenum {
UITableViewCellStyleDefault,// Simple cell with text label and optional image view (behavior of UITableViewCell in iPhoneOS 2.x 显示标签和图片的简单表单元
UITableViewCellStyleValue1,// Left aligned label on left and right aligned label on right with blue text (Used in Settings)
UITableViewCellStyleValue2,// Right aligned label on left with blue text and left aligned label on right (Used in Phone/Contacts)
UITableViewCellStyleSubtitle// Left aligned label on top and left aligned label on bottom with gray text (Used in iPod).
} UITableViewCellStyle; // available in iPhone OS 3.0
主要是在于这两段代码:
- (UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
- UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyIdentifier"];
- if (cell == nil) {
- cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"MyIdentifier"];
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- }
- NSDictionary *item = (NSDictionary *)[self.content objectAtIndex:indexPath.row];
- cell.textLabel.text = [item objectForKey:@"mainTitleKey"]; 主标题-top
- cell.detailTextLabel.text = [item objectForKey:@"secondaryTitleKey"]; 副标题-bottom
- NSString *path = [[NSBundle mainBundle] pathForResource:[item objectForKey:@"imageKey"] ofType:@"png"];
- UIImage *theImage = [UIImage imageWithContentsOfFile:path];
- cell.imageView.image = theImage;
- return cell;
- tableview 显示主副标题的样式
- uibuuton 折行显示 主标题,副标题
- android 用RingtonePreference显示副标题 summary的注意事项
- Android RingtonePreference 显示副标题 summary
- tableView的显示步骤
- tableView选择分组样式时第一组的headView不显示的情况分析
- 在文章中主标题和副标题的格式问题
- tableview样式
- tableview 按字母排序分区 并加对应副标题
- tableView 的 cell 的分割线样式
- 征集咱们BLOG的副标题!
- 获取tableViewcell副标题的方法
- QT设置TableView的标题样式
- 自定义tableview Header和Footer的样式
- 状态栏,tableView分区样式的设置
- ios tableview一些样式的整理
- 自定义tableView编辑样式的图标
- tableView的plain 和grouped 样式
- Python抓取中文网页
- WIZnet智能电表成功案例 Smart Meter Success Story
- 淘宝Fourinone介绍及与Hadoop的性能PK
- 手把手教你在Windows环境下下载Android源码(Launcher为例)
- 设计模式-单例模式
- tableview 显示主副标题的样式
- capfile 详解
- 学习资源
- booktabs宏包画三线表,线条精细可变
- 三五杆枪,可干革命,三五个人,可以创业
- cocos2d 传送门
- sql语句拼接时,添加单引号
- postgreSQL 在日期的基础上增加年份再减去一天的方法
- 进程和线程的关系