带有用于突出显示的图像的自定义 UITableViewCell [英] custom UITableViewCell with image for highlighting

查看:31
本文介绍了带有用于突出显示的图像的自定义 UITableViewCell的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个自定义 UITableViewCell(从 XIB 实例化),以图像为背景.现在我想要另一个图像作为选择单元格时的背景(类似于标准单元格的蓝色闪烁).我已经尝试在 (void)setSelected:(BOOL)selected animation:(BOOL)animated 或什至在 didSelectRowAtIndexPath 中使用 setSelectedBackgroundView 设置它,但是突出显示的背景不会出现.我做错了什么?

I have a custom UITableViewCell (instantiated from XIB) with an image as background. Now I want another image to be the background when the cell is selected (similar to the blue flashing for standard cells). I already tried setting it using setSelectedBackgroundView in (void)setSelected:(BOOL)selected animated:(BOOL)animated or even in didSelectRowAtIndexPath but the background for highlighting wont show up. What am I doing wrong?

推荐答案

In your Custom Cell.xib

接下来做这个

最后做到这一点

这篇关于带有用于突出显示的图像的自定义 UITableViewCell的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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