iphone - UITableViewCell 背景颜色与 alpha 不同的行为

标签 iphone uitableview uicolor ios7

我设置了相同的颜色([UIColor colorWithWhite:1 alpha:0.8])对于 TableHeader以及每一行(对于 in Row in layoutSubviews )。它在 iOS 6 中效果很好和iOS 5但在 iOS 7我的行为有所不同。

此颜色以相同的方式适用于标题,但对于单元格 alpha 变为 1。我将其设置为 0.6,并且外观类似于 iOS 6 or 5 的 alpha 0.8。 .

所以问题是:通过为TableHeader设置相同的alpha (或其他 View )和 TableViewCell我们会得到不同的外观,但我需要相同的外观,而且我不想破解。

还有一个,[UIColor colorWithWhite:1 alpha:0];

它变得完全透明,所以我认为下面没有 View 。

最佳答案

我找到了最好的解决方案:

self.backgroundColor = [UIColor clearColor];
self.contentView.backgroundColor = [UIColor colorWithRed: 68.0/255.0 green: 125.0/255.0 blue: 190.0/255.0 alpha: 0.8];

关于iphone - UITableViewCell 背景颜色与 alpha 不同的行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18736967/

相关文章:

swift - 如何将字符串转换为 UIColor (Swift)

ios - 应用程序崩溃,即使除了带有 Swift 2 的 Xcode 中的代码之外什么都没有

ios - 如何确保随机的UIColors在iOS中的白色背景上可见

iphone - iPhone上的sqlite删除问题

iphone - NSOperation和NSURLConnection冲突

iphone - MKMapView map 类型没有改变?

iphone - 如果我不处理音频中断会怎样?

ios - 使用不同的行数重新加载 UITableView

ios - 对齐 UITableViewHeaderFooterView 的 detailTextLabel

iOS - 方法正在处理时禁用行选择