iOS 8:通过UIAppearance设置背景颜色UITableView [英] iOS 8: setting background color UITableView via UIAppearance

查看:105
本文介绍了iOS 8:通过UIAppearance设置背景颜色UITableView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我习惯于执行以下操作来设置 UITableView的所有实例

i am used to doing the following to style all instances of UITableView:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [[UITableView appearance] setBackgroundColor:[UIColor blueColor]];
    return YES;
}

但ios 8 这是不再工作

为了测试和演示,我使用xcode 6.0.1创建了一个新的主 - 详细信息项目,你可以找到在github上

在ios 7上运行它(表格视图获得蓝色背景) )。在ios 8上没那么多。

for the purpose of testing and demo i created a new master-detail project using xcode 6.0.1 which you can find on github.
running it on ios 7 works (table view gets blue background). on ios 8 not so much.

在炒作期间我是否错过了什么?这是一个错误吗?

did i miss someting during the hype? is this a bug?

这似乎是一个已知错误。苹果雷达#是17974434,目前标记为 open

this appears to be a known bug. the apple radar # is 17974434 which is currently marked as open.

推荐答案

它对我有用:

[[UITableView appearance] setBackgroundColor:[UIColor clearColor]];
[[UITableView appearance] setBackgroundColor:[UIColor blueColor]];

这篇关于iOS 8:通过UIAppearance设置背景颜色UITableView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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