UITableView 清除背景 [英] UITableView clear background

查看:29
本文介绍了UITableView 清除背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我意识到 iOS 7 还没有正式发布,我们不应该讨论它,但我想弄清楚这个问题我快疯了.在 iOS 6 上,我的表格视图是透明的,看起来很棒.第一次运行iOS 7,背景为白色.

I realize that iOS 7 has not officially been released and we should not discuss it BUT I am going crazy trying to figure out this problem. On iOS 6, my table view was transparent and looked great. First time running iOS 7, and the background is white.

我尝试将表格背景颜色、单元格颜色等设置为 UIColor clearColor 但没有任何变化.

I have tried making the table backgroundColor, cell color etc etc to UIColor clearColor but have no change.

如何解决这个问题?

推荐答案

    // Fix for iOS 7 to clear backgroundColor
    cell.backgroundColor = [UIColor clearColor];
    cell.backgroundView = [[UIView new] autorelease];
    cell.selectedBackgroundView = [[UIView new] autorelease];

在 cellForRowAtIndexPath 中

in cellForRowAtIndexPath

此外,请确保您的 tableview 实际上具有透明背景(在故事板中):

Also, make sure that your tableview actually has transparent background (in storyboard):

这篇关于UITableView 清除背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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