- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:nil]; // 设置cell右边指示器的类型
if (indexPath.row % == ) {
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
} cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
cell.accessoryView = [[UISwitch alloc] init]; // 设置背景(背景view不用设置尺寸, backgroundView的优先级 > backgroundColor)
UIImageView *bgView = [[UIImageView alloc] init];
bgView.image = [UIImage imageNamed:@"buttondelete"];
// bgView.backgroundColor = [UIColor redColor];
cell.backgroundView = bgView; UIView *selectedbgView = [[UIView alloc] init];
selectedbgView.backgroundColor = [UIColor greenColor];
cell.selectedBackgroundView = selectedbgView;
return cell;
}

ios UITableView背景图片设置的更多相关文章

  1. Android TextView背景颜色与背景图片设置

    Android TextView 背景颜色与背景图片设置,android textview 控件,android textview 背景, android textview 图片,android te ...

  2. JAVA GUI学习 - 窗体背景图片设置方法:重写paintComponent(Graphics g)方法

    public class BackgroundImage extends JFrame { public BackgroundImage() { this.setTitle("窗体背景图片设 ...

  3. css样式背景图片设置缩放

    一.背景颜色图片平铺 background-color 背景颜色 background-image 背景图片地址 background-repeat 是否平铺 默认是平铺 background-pos ...

  4. UIView UITableView 背景图片添加

    这几天,经常用到为某个视图设置背景图片,而API中UIView没有设置背景图片的方法,搜集归纳如下: 第一种方法: 利用的UIView的设置背景颜色方法,用图片做图案颜色,然后传给背景颜色. UICo ...

  5. 【CSS】css网页背景图片设置

    刚学CSS,了解了下网页背景图设置,顺便记录下. 下面主要是实现背景图位置保持不变,即不随滚动条动而动的功能. body { background-image:url(images/bck.png); ...

  6. TextView字体和背景图片 设置透明度

    背景图片透明度设置  viewHolder.relative_layout.getBackground().setAlpha(225);     0  ---  225 ((TextView)tv). ...

  7. WPF Button的背景图片设置

    这个问题很简单,但是对于从winfrom转过来的来讲,在做事的时候就会被绕进去,言归正传,如何设置一个bUtton的背景图片?如何去掉让人烦的默认选中时的灰色背景?请看如下的描述.问题的来源和解决都在 ...

  8. QT:给Widget设置背景图片——设置Widget的调色板,调色板使用图片和背景色

    QT:给Widget设置背景图片 1 /*2 * set background image3 */4 QPixmap bgImages(":/images/bg.png");5 Q ...

  9. MFC 窗体背景图片设置

    很多人在做MFC 界面的时候想要给对话框加入背景图片,很多人都会想到在OnPaint()里面来加一段代码来实现,其实这样做并不怎么科学,因为它会导致窗口不断重绘,在很多项目中窗口会闪烁(比如带播放视频 ...

随机推荐

  1. Vue音乐项目笔记(三)

    1. 音乐播放前进后退的实现   https://blog.csdn.net/weixin_40814356/article/details/80379606 2. 音乐进度条实现(单独一个组件) h ...

  2. 迭代FFT

    int reverse(int x, int len){ ; ; i < len; i <<= ){ t <<= ; ; } return t; } Complex A[ ...

  3. 【PowerDesigner】【6】Table视图同时显示Code和Name

    效果图: —————————————————————— 步骤: 文字版: 1,顶部工具栏Tools→Display Preference 2,Columns→List columns右侧按钮 3,勾选 ...

  4. windows 系统使用 git 和码云管理代码(本地已有项目)

    1. 为本地项目创建本地仓 找到项目所在的根目录(目录下有解决方案那个),右击目录,点击右键菜单中的“Git Bash Here”(前提是你的电脑已经装了Git,我用的是TortoiseGit) 然后 ...

  5. 【Python】基础知识

    一.基本概念 1.变量与运算符 Python允许给多个变量同时赋值,等号 (=) 右边的值将赋予左边对应位置的变量. # 将a, b, c的值依次赋予b, c, a b, c, a = a, b, c ...

  6. [luogu P2324] [SCOI2005]骑士精神

    [luogu P2324] [SCOI2005]骑士精神 题目描述 输入输出格式 输入格式: 第一行有一个正整数T(T<=10),表示一共有N组数据.接下来有T个5×5的矩阵,0表示白色骑士,1 ...

  7. [洛谷 P3239] [HNOI2015]亚瑟王

    [HNOI2015]亚瑟王 题目描述 小 K 不慎被 LL 邪教洗脑了,洗脑程度深到他甚至想要从亚瑟王邪教中脱坑.他决定,在脱坑之前,最后再来打一盘亚瑟王.既然是最后一战,就一定要打得漂亮.众所周知, ...

  8. eclipse初学者的使用

    eclipse的使用 字体设置:      设置环境字符: 设置背景颜色 寻找窗口: java JDK的配置: 配置自动提示: 适合初学者适应环境开发.

  9. Python线程二

    转自:https://www.cnblogs.com/chengd/articles/7770898.html 1. threading.Lock() import threading balance ...

  10. 回声UDP服务器端/客户端

    UDP是具有数据边界的协议,传输中调用I/O函数的次数非常重要.输入函数的调用次数要和输出函数的调用次数完全一致,这样才能保证接受全部已发送的数据. TCP套接字中需注册待传输数据的目标IP和端口,而 ...