简体   繁体   English

无需IB即可更改自定义单元格的背景

[英]Change custom cell's background without IB

I'm overloading my brains on this one. 我在这上面使我的大脑超负荷。

I've created a table, which contains custom cells (one of a kind). 我创建了一个表,其中包含自定义单元格(一种)。 A few days back, I changed the background to the grey you can see in the picture below here. 几天前,我将背景更改为灰色,如下图所示。

Now I don't know how I did that.... 现在我不知道我是怎么做到的... 在此处输入图片说明

I don't think I did this programatically... What else would explain the color in IB? 我不认为我是通过编程方式完成的……还有什么能解释IB中的颜色? I also searched my sourcecode, and the line for coloring the cell through code is commented out. 我还搜索了源代码,并通过代码为单元格着色的行被注释掉了。

I need to reproduce this coloring on other custom cells. 我需要在其他自定义单元格上重现这种颜色。 How the heck did I do this? 我到底是怎么做到的? :D :D

Ah, I thought of the answer while getting a cup of coffee: 啊,我在喝咖啡时想到了答案:

Change the tableView's background (so, an other .xib-file) to the grey color to get that effect... 将tableView的背景(另一个.xib文件)更改为灰色以获得这种效果...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 IB自定义UITableViewCell-单元格和detailText的动态高度 - IB Custom UITableViewCell - Dynamic Height for cell and detailText 使用IB加载数据的UITableViewCell自定义单元格 - UITableViewCell custom cell using IB loading data 如何在不使用情节提要或IB的情况下从嵌入式集合视图的单元导航到另一个视图控制器? - How to navigate from an embedded collection view’s cell to another view controller without using Storyboard or IB? 自定义单元格-更改自定义单元格中背景和按钮的颜色 - Custom Cell - Change color of background and button in custom cell 突出显示单元格时更改为自定义背景 - Change to custom background when a cell is highlighted 更改自定义表格视图单元格的图像 - Change custom tableview cell's image 如何更改自定义单元格的UILabel文本? - How to change Custom Cell's UILabel Text? iOS:带有代码和IB的自定义单元格属性不会一起出现 - iOS: Custom Cell Properties with Code and IB do not appear together 是否可以在不制作自定义单元格类的情况下更改单元格的图像? - Is it possible to change image of cell without making a custom cell class? 分组UITableView自定义绘制单元格,而不更改背景颜色? - Grouped UITableView custom draw cell, without changing background color?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM