// 设置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. 关于Bonobo Git Server的安装

    1.关于安装 参考官网:https://bonobogitserver.com/ 实际上就是在IIS上搭建一个MVC程序.安装教程:https://bonobogitserver.com/instal ...

  2. Lucene TF-IDF 相关性算分公式

    转自: http://lutaf.com/210.htm Lucene在进行关键词查询的时候,默认用TF-IDF算法来计算关键词和文档的相关性,用这个数据排序 TF:词频,IDF:逆向文档频率,TF- ...

  3. Gift for GS5

    // // main.cpp // 生日快乐 // // Created by wasdns on 16/11/21. // Copyright © 2016年 wasdns. All rights ...

  4. python collections deque

    collections是python的高级容器类库,包含了dict.truple之外的常用容器. 下面介绍常用的deque 1. deque是双端队列,可以从两端塞元素进去,也可以从两端取元素. 2. ...

  5. ThinkPHP开发笔记-模型

    1.模型定义.在ThinkPHP中,可以无需进行任何模型定义.只有在需要封装单独的业务逻辑的时候,模型类才是必须被定义的,因此ThinkPHP在模型上有很多的灵活和方便性,让你无需因为表太多而烦恼. ...

  6. LeetCode第[98]题(Java):Validate Binary Search Tree(验证二叉搜索树)

    题目:验证二叉搜索树 难度:Medium 题目内容: Given a binary tree, determine if it is a valid binary search tree (BST). ...

  7. activity之间通过全局变量传递数据

    activity之间通过全局变量传递数据 一.简介 Application域中的onCreate方法是Android程序的入口,Android程序运行的时候就自动加载Application的对象,感觉 ...

  8. layui弹窗宽度固定高度自适应界面

    //默认上下15px的边距高度,可根据需要修改function layuiDialogFitScreen(){ var layui_title_height=$(window.parent.docum ...

  9. Java中Collection 的基本认识

    集合Conllection的基本概念:1.集合的基本认识:如StringBuffer&StringBuilder是集合(存储的对象类型是String).数组.对象与其很相似,但是还有区别.2. ...

  10. Windows、Ubuntu双系统正确卸载Ubuntu系统

    先判断启动方式,以管理员身份打开cmd或者power shell,输入bcdedit,找到path那一行,如果是winload.efi就是uefi引导,若为exe就是legacy引导 或者win+r输 ...