在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上显示一些标题.详情等内容,在加上一张图片.这里说一下这种思路. 为了防止图片多次下载, ...
随机推荐
- redis命令的使用
批量删除特定前缀的keys redis-cli KEYS "prefix:*" | xargs redis-cli DEL 返回list的长度 > LPUSH test &q ...
- Mysql binlog设置
一:Binlog文件信息 1. binlog基本定义:二进制日志,也成为二进制日志,记录对数据发生或潜在发生更改的SQL语句,并以二进制的形式保存在磁盘中: 2. 作用:MySQL的作用类似于Ora ...
- 8.scala:特质
版权申明:转载请注明出处.文章来源:http://bigdataer.net/?p=317 总体来说,scala中的特质类似于Java中的接口,但是有别于接口的是特质中既可以有实现方法也可以有抽象方法 ...
- eclipse不能添加tomcat7的问题
问题如下: 解决问题: 1.把eclipse先关了 2.把eclipse的工作空间的两个文件删除 org.eclipse.jst.server.tomcat.core.prefs和org.eclips ...
- eclipse及tomcat web站點
eclipse环境下如何配置tomcat https://www.cnblogs.com/Leo_wl/p/4769760.htmleclipse环境下如何配置tomcat,并且把项目部署到Tomca ...
- input输入框延时发送请求问题
同样是面试遇到的问题,input输入框,怎么减少发送请求次数. 键盘抬起触发事件,首先清除定时器,再开启定时器.只要小于1s的连续输入,都会先把上一次定时器清除.停顿一秒后,开始执行请求事件(此处为c ...
- 第三天 RHEL7-Unix/Linux系统 介绍
如何称为一名优秀的linux运维人员? 如果你有机会和条件:环境能够磨练一个人的能力和意志. 大胆的做你从未做过的项目,每一个项目都是对自身的极大提升. 有好的环境资源不要浪费,好好把握,慢慢进步. ...
- 普通for循环遍历LinkedList弊端
java开发过程中,用到的最多的List集合就属ArrayList与LinkedList.对于ArrayList的遍历,通常是下面的方法: public static void main(String ...
- no persistent classes found for query class: FROM com.vrv.paw.domain.User
在整合Spring+Hibernate时报该错误,sessionFactory配置如下: <bean id="sessionFactory" class="org. ...
- Nginx1.8 安装说明
安装Nginx .安装pcre cd /usr/local/src mkdir /usr/local/pcre tar zxvf pcre-8.36.tar.gz cd pcre-8.36 ./con ...