【问题标题】:Setting background to GroupTableViewBackgroundColor将背景设置为 GroupTableViewBackgroundColor
【发布时间】:2012-09-23 01:13:24
【问题描述】:

我的 Monotouch iPhone 应用程序中有一个 UIViewController,我想将背景设置为 UITableViewStyle.Grouped 中的背景。但是,当我使用下面的代码时,它会返回一个黑屏。

this.View.BackgroundColor = UIColor.GroupTableViewBackgroundColor;  // Black screen
this.View.BackgroundColor = UIColor.Red; // Works

我在 ViewWillAppear 方法中调用它们。如果我注释掉 GroupTable,则背景设置为红色。当我注释掉第二行时,我得到的只是黑屏。

有人知道这是为什么吗?如果您不在 UITableViewController 中,您可以不调用 UIColor.GroupTableViewBackgroundColor 吗?

谢谢

迈克

【问题讨论】:

    标签: xamarin.ios uitableview


    【解决方案1】:

    我在我当前的项目中使用了它,它工作正常我有 xcode 4.0 和模拟器 4.3 我在网上发现它在 ios 6 上已弃用 我用过这样的

    [self.tableview setBackgroundColor:[UIColor groupTableViewBackgroundColor]];
    

    看看这个链接is groupTableViewBackgroundColor deprecated on iOS 6?

    您可以在互联网上找到与 UItableview 分组样式背景相同的图像。

    【讨论】:

    • 谢谢 - 我正在 iOS6 中开发,所以我的问题是它已被弃用。
    猜你喜欢
    • 2019-06-13
    • 1970-01-01
    • 2012-03-05
    • 2015-11-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多