// 设置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的图片和文字的更多相关文章

  1. iOS中关于动态Tableview中的cell数据传输的多线程问题解决之拙见

    iOS中关于动态Tableview中的cell数据传输的多线程问题解决之拙见 (2015-12-05 12:48:20)[编辑][删除] 转载▼     首先我们先明确一下问题: 1.因为UI是在主线 ...

  2. 使用HVTableView动态展开tableView中的cell

    使用HVTableView动态展开tableView中的cell 效果: 源码: HVTableView.h 与 HVTableView.m // // HVTableView.h // HRVTab ...

  3. 动态切换tableView中的cell的种类

    动态切换tableView中的cell的种类 为什么要动态切换tableView中cell的种类呢?如果项目经理不出这种需求,你也就见不到这篇文章了:) 效果: 源码: 首先,你要准备3种cell,直 ...

  4. IOS中设置cell的背景view和选中时的背景view 、设置cell最右边的指示器(比如箭头\文本标签)

    一.Cell的设置 1.设置cell的背景view和选中时的背景view UIImageView *bg = [[UIImageView alloc] init]; bg.image = [UIIma ...

  5. IOS 在IOS6中设置navigationBar背景图片 会有一条 黑色阴影 --- 解决方案

    //给navigationBar设置背景图片 if ([self.navigationController.navigationBar respondsToSelector:@selector(set ...

  6. markdown中设置、调整图片尺寸

    使用百分比描述尺寸 <img src="https://img2018.cnblogs.com/blog/1122471/201902/1122471-2019022218575673 ...

  7. C# Word文档中插入、提取图片,文字替换图片

    Download Files:ImageOperationsInWord.zip 简介 在这篇文章中我们可以学到在C#程序中使用一个Word文档对图像的各种操作.图像会比阅读文字更有吸引力,而且图像是 ...

  8. iOS TabbarController 设置底部Toolbar图片和文字颜色选中样式

    提取公共方法: -(void)createChildVcWithVc:(UIViewController *)vc Title:(NSString *)title image:(NSString *) ...

  9. iOS Cell异步图片加载优化,缓存机制详解

    最近研究了一下UITbleView中异步加载网络图片的问题,iOS应用经常会看到这种界面.一个tableView上显示一些标题.详情等内容,在加上一张图片.这里说一下这种思路. 为了防止图片多次下载, ...

随机推荐

  1. Python多版本共存管理工具之pyenv

    目录 Table of Contents 1. 安装pyenv 2. 安装Python 3.0 使用python 参考 Table of Contents 经常遇到这样的情况: 系统自带的Python ...

  2. [BZOJ2109]Plane 航空管制

    Description 世博期间,上海的航空客运量大大超过了平时,随之而来的航空管制也频频 发生.最近,小X就因为航空管制,连续两次在机场被延误超过了两小时.对此, 小X表示很不满意. 在这次来烟台的 ...

  3. Keepalived+Nginx实现高可用(HA)

    Keepalived+Nginx实现高可用(HA) service iptables stopchkconfig iptables offsetenforce 0/etc/selinux/config ...

  4. hbase(二)hfile结构

    HFile结构 截止hbase 1.0.2版本,hfile已经有3个版本,要深入了解hfile的话,还是要从第一个版本开始看起. hfile v1 Data Block:保存表中的数据,这部分可以被压 ...

  5. 【视觉基础知识】Bag of words 在图像中的应用

    文章转载自:https://www.cnblogs.com/shihuajie/p/5782515.html BOW (bag of words) 模型简介 Bag of words模型最初被用在文本 ...

  6. 在Mac中如何正确地设置JAVA_HOME

    前期准备 下载JDK安装包:在JDK1.8下载中选择Mac的JDK安装包 安装JDK:这里只要按照安装指引一步一步安装即可 查找JAVA_HOME 打开Mac的终端,检查JDK是否安装成功:java ...

  7. [转]基于Visual Studio 2010 进行敏捷/Scrum模式开发

    http://www.infoq.com/cn/articles/visual-studio-2010-agile-scrum-development 根据Forrester Research今年第二 ...

  8. 以普通用户启动的Vim如何保存需要root权限的文件

    在Linux上工作的朋友很可能遇到过这样一种情况,当你用Vim编辑完一个文件时,运行:wq保存退出,突然蹦出一个错误: E45: 'readonly' option is set (add ! to ...

  9. linux bash shell中,单引号、 双引号,反引号(``)的区别及各种括号的区别

    一.单引号和双引号 首先,单引号和双引号,都是为了解决中间有空格的问题. 因为空格在Linux中时作为一个很典型的分隔符,比如string1=this is astring,这样执行就会报错.为了避免 ...

  10. 25.大白话说java并发工具类-CountDownLatch,CyclicBarrier,Semaphore,Exchanger

    1. 倒计时器CountDownLatch 在多线程协作完成业务功能时,有时候需要等待其他多个线程完成任务之后,主线程才能继续往下执行业务功能,在这种的业务场景下,通常可以使用Thread类的join ...