// 设置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. RedHat7.4最小化安装yum源不可用问题解决

    本次安装的RedHat7.4是安装在Oracle VM VirtualBox5.2.8虚拟机上面的,本文不对安装虚拟机步骤做详细说明. 工具准备: Oracle VM VirtualBox5.2.8 ...

  2. Android Device Monitor 文件管理使用的常见问题

    本文参照博客:http://blog.csdn.net/aurorayqz/article/details/65705300.以下是我的实际操作. 1.使用Android Device Monitor ...

  3. 【TensorFlow/简单网络】MNIST数据集-softmax、全连接神经网络,卷积神经网络模型

    初学tensorflow,参考了以下几篇博客: soft模型 tensorflow构建全连接神经网络 tensorflow构建卷积神经网络 tensorflow构建卷积神经网络 tensorflow构 ...

  4. java 集合操作小结

    Map<String,String> m1=new HashMap<String,String>(); m1.put("zara", "name1 ...

  5. Asp.Net将Session保存在数据库中

    1.由于项目dll文件变动比较频繁,而保存登陆的状态又保存在Session中,所以导致用户经常无故掉线.(dll变动的时候导致Session丢失) 2.有一种方法可以长期保存session,那就是se ...

  6. Object.assign() 从一个或多个源对象复制到目标对象

    Object.assign()方法用于将所有可枚举属性的值从一个或多个源对象复制到目标对象.它将返回目标对象. 1.语法: Object.assign(target, ... , sources) 参 ...

  7. EclipseError01

    1.错误:“javax.servlet.http.httpservlet was not found on the Java Build Path” 1.1. 项目上右键-->Build Pat ...

  8. Warsaw U Contest Petrozavo dsk Summer 2011 Training Camp, Monday, September 5, 2011

    Warsaw U Contest Petrozavo dsk Summer 2011 Training Camp, Monday, September 5, 2011 Problem A.Chocol ...

  9. Spring Boot技术栈博客笔记(1)

    要实现的核心功能 用户管理 安全设置 博客管理 评论管理 点赞管理 分类管理 标签管理 首页搜索 核心技术 数据存储 随着spring3发布以来,spring团队减少使用xml配置的使用,采用大量约定 ...

  10. dapper-dot-net/Dapper NET40/SqlMapper.cs

    /* License: http://www.apache.org/licenses/LICENSE-2.0 Home page: http://code.google.com/p/dapper-do ...