如何更改 UITableViewCell 的蓝色高亮颜色? [英] How to change the blue highlight color of a UITableViewCell?

查看:36
本文介绍了如何更改 UITableViewCell 的蓝色高亮颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何更改 UITableViewCell 的蓝色突出显示/选择颜色,有什么想法吗?

I'm wondering how to change the blue highlight/selection color of a UITableViewCell, any ideas?

推荐答案

您可以通过多种方式更改突出显示颜色.

You can change the highlight color in several ways.

  1. 更改单元格的 selectionStyle 属性.如果你把它改成UITableViewCellSelectionStyleGray,它会是灰色的.

更改 selectedBackgroundView 属性.实际上创建蓝色渐变的是一个视图.您可以创建一个视图并绘制您喜欢的任何内容,并将该视图用作表格视图单元格的背景.

Change the selectedBackgroundView property. Actually what creates the blue gradient is a view. You can create a view and draw what ever you like, and use the view as the background of your table view cells.

这篇关于如何更改 UITableViewCell 的蓝色高亮颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆