在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上显示一些标题.详情等内容,在加上一张图片.这里说一下这种思路. 为了防止图片多次下载, ...
随机推荐
- ubuntu搭建tiny4412环境【学习笔记】
一.安装完系统之后需要执行如下步骤 1.sudo apt-get update 更新软件源 2.sudo apt-get install vsftpd openssh-server nfs-kerne ...
- [BZOJ1722]Milk Team Select 产奶比赛
Description Farmer John's N (1 <= N <= 500) cows are trying to select the milking team for the ...
- CentOS安装wkhtmltopdf及解决中文支持问题
安装wkhtmltopdf,先下载 wkhtmltox-0.12.2.1_linux-centos6-amd64.rpm yum install -y wkhtmltox-0.12.2.1_linu ...
- linux下安装sphinx
1.下载sphinx源码包 上面截图的这个网址 复制链接地址 在putty终端使用:wget http://sphinxsearch.com/files/sphinx-2.3.1-beta.t ...
- vue编译环境和线上环境url切换
新建一个配置js,导入到接口请求管理类,可以自动根据环境切换if (process.env.NODE_ENV == 'development') { baseUrl = ''; }else{ base ...
- Union 和Union all的区别
Union:对两个结果集进行并集操作,不包括重复行,同时进行默认规则的排序: Union All:对两个结果集进行并集操作,包括重复行,不进行排序: 例如: select employee_id,jo ...
- 分析ReentrantLock的实现原理
http://www.jianshu.com/p/fe027772e156 什么是AQS AQS即是AbstractQueuedSynchronizer,一个用来构建锁和同步工具的框架,包括常用的Re ...
- Vim练级攻略(转)
转自平凡的世界:http://www.ccvita.com/ 前言今天看到这篇文章,共鸣点非常多.它把Vim使用分为4个级别,目前我自己是熟练运用前面三级的命令,在培养习惯使用第四级.完全就是我这一年 ...
- pycharm社区版创建django项目(Windows 8.1)
django是Python的一个开源web框架,在pycharm开发环境中,pycharm专业版在新建一个项目的时候有django选项,帮助创建一个django框架的项目.pycharm社区版需要自己 ...
- PHP 数组遍历 foreach 语法结构
foreach 语法结构用于遍历数组. foreach() PHP foreach() 语法结构用于遍历操作或输出数组,foreach() 仅能用于遍历数组或对象,当试图将其用于其它数据类型或者一个未 ...