在tableView中设置cell的图片和文字
// 设置UITableViewCellEditingStyle的 accessoryType
UITableViewCellAccessoryNone, // don't show any accessory view
UITableViewCellAccessoryDisclosureIndicator, // regular chevron. doesn't track
UITableViewCellAccessoryDetailDisclosureButton, // info button w/ chevron. tracks
UITableViewCellAccessoryCheckmark, // checkmark. doesn't track
UITableViewCellAccessoryDetailButton
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *ID = @"yxcell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
if (cell == nil) {
cell = [[UITableViewCellalloc]initWithStyle:UITableViewCellStyleSubtitlereuseIdentifier:ID];
cell.textLabel.backgroundColor = [UIColorclearColor];
cell.detailTextLabel.backgroundColor = [UIColorclearColor];
cell.detailTextLabel.font = [UIFontsystemFontOfSize:14];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
// cell.selectionStyle = UITableViewCellSelectionStyleNone;
// cell的背景颜色
UIView *bg = [[UIView alloc] init];
bg.backgroundColor = [UIColorbrownColor];
cell.backgroundView = bg;
// cell选中的时的背景颜色
UIView *bgv = [[UIView alloc]init];
bgv.backgroundColor = [UIColorredColor];
cell.selectedBackgroundView = bgv;
}
// UIImage *image = [UIImage imageNamed:@"111.jpg"];
// cell.imageView.image = image;
cell.imageView.image = [UIImageimageNamed:@"111.jpg"] ;
cell.textLabel.text = @"smile集团";
cell.detailTextLabel.text = @"看清楚了";
return cell;
}
在tableView中设置cell的图片和文字的更多相关文章
- iOS中关于动态Tableview中的cell数据传输的多线程问题解决之拙见
iOS中关于动态Tableview中的cell数据传输的多线程问题解决之拙见 (2015-12-05 12:48:20)[编辑][删除] 转载▼ 首先我们先明确一下问题: 1.因为UI是在主线 ...
- 使用HVTableView动态展开tableView中的cell
使用HVTableView动态展开tableView中的cell 效果: 源码: HVTableView.h 与 HVTableView.m // // HVTableView.h // HRVTab ...
- 动态切换tableView中的cell的种类
动态切换tableView中的cell的种类 为什么要动态切换tableView中cell的种类呢?如果项目经理不出这种需求,你也就见不到这篇文章了:) 效果: 源码: 首先,你要准备3种cell,直 ...
- IOS中设置cell的背景view和选中时的背景view 、设置cell最右边的指示器(比如箭头\文本标签)
一.Cell的设置 1.设置cell的背景view和选中时的背景view UIImageView *bg = [[UIImageView alloc] init]; bg.image = [UIIma ...
- IOS 在IOS6中设置navigationBar背景图片 会有一条 黑色阴影 --- 解决方案
//给navigationBar设置背景图片 if ([self.navigationController.navigationBar respondsToSelector:@selector(set ...
- markdown中设置、调整图片尺寸
使用百分比描述尺寸 <img src="https://img2018.cnblogs.com/blog/1122471/201902/1122471-2019022218575673 ...
- C# Word文档中插入、提取图片,文字替换图片
Download Files:ImageOperationsInWord.zip 简介 在这篇文章中我们可以学到在C#程序中使用一个Word文档对图像的各种操作.图像会比阅读文字更有吸引力,而且图像是 ...
- iOS TabbarController 设置底部Toolbar图片和文字颜色选中样式
提取公共方法: -(void)createChildVcWithVc:(UIViewController *)vc Title:(NSString *)title image:(NSString *) ...
- iOS Cell异步图片加载优化,缓存机制详解
最近研究了一下UITbleView中异步加载网络图片的问题,iOS应用经常会看到这种界面.一个tableView上显示一些标题.详情等内容,在加上一张图片.这里说一下这种思路. 为了防止图片多次下载, ...
随机推荐
- 入手sm961
测速: 发现这个测速软件不同版本测试还不一样 下面是我的intel750的,用最新版本测试软件测的 淘宝买了一个散热片
- Commons Configuration之一简介
转载自(https://my.oschina.net/u/2000201/blog/486327) 1 简介 Commons Configuration软件类库提供通用配置接口,使Java应用程 ...
- This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' 解决办法
背景:mysql5.1.36,mybatis 前言:为了解决一对多,分页显示,但是前端主要是显示的一的一方的数据和(多方的某个字段拼接在一起),此时的limit不能直接跟在查询的后面,需要用子查询把需 ...
- Python学习札记(十九) 高级特性5 迭代器
参考:迭代器 Note 1.可用于for循环的对象有两类:(1)集合数据类型:list tuple dict str set (2)Generator:生成器和含yield语句的函数.这些可以直接作用 ...
- Nginx的坑
Nginx的重启命令:./nginx -s reload 有时候没有效果,原因不知, 要重启可以使用:killall nginx,然后./nginx (就是先kill掉Nginx,然后再重启Ngi ...
- Springboot依赖注入笔记
结合Autowired和Service注解 public interface IUser { void say(); } @Service public class Student implement ...
- PHPCMSV9的CKEDITOR编辑器增加行距
lineheight插件,下载地址:http://files.cnblogs.com/ysfng/ckeditor-lineheight.zip 第一步,下载lineheight插件,并解压到\cke ...
- cassandra 之 在spark-shell 中使用 spark cassandra connector 完整案例
1.cassandra 准备 启动cqlsh, CQLSH_HOST=172.16.163.131 bin/cqlsh cqlsh>CREATE KEYSPACE productlogs WIT ...
- css实现标题文字过长截取...
css实现网页中文字过长截取... title class应该这样写: .title{ width:300px; white-space:nowrap; overflow:hidden; text-o ...
- javascript中对变量类型的判断
本文正式地址:http://www.xiabingbao.com/javascript/2015/07/04/javascript-type 在JavaScript中,有5种基本数据类型和1种复杂数据 ...