【问题标题】:UITableView backgroundColor always gray on iPad, Solution for MonotouchUITableView backgroundColor在iPad上总是灰色,Monotouch的解决方案
【发布时间】:2012-06-06 21:23:54
【问题描述】:

我遇到了this question 中描述的相同问题,只是我使用的是 Monotouch,而不是 Objective-C。我也在使用 Monotouch-Dialog 而不是 Interface Builder。

所以,总结一下这个问题,在 iPad 上,分组 UITableView 的背景始终是灰色的,而在 iPhone 上,它显示标准的条纹背景。当应用程序在 iPad 上运行时,我希望获得相同的条纹背景。

我在 ViewDidLoad 覆盖方法中尝试了以下方法(基于我链接的问题中发布的答案),但它不起作用:

public class SyncDialog : DialogViewController
{
    public override void ViewDidLoad ()
    {
        this.TableView.BackgroundView = new UIView();
        base.ViewDidLoad ();
    }
}

有谁知道如何让 iPad 上的 Monotouch.Dialog DialogViewController 的背景与 上显示的一致iPhone

更新:

我还尝试将 tableview 的 BackgroundColor 更改为 UIColor.Clear 作为对同一问题的另一个答案。所以我补充说:

this.TableView.BackgroundColor = UIColor.Clear;

但这也无济于事。我还尝试将 this.TableView.BackgroundView 设置为 null 而不是实例化另一个 UIView 对象。但是通过这两个更改,我只得到了黑色背景。

【问题讨论】:

    标签: ipad uitableview xamarin.ios monotouch.dialog


    【解决方案1】:

    您引用的示例还表明您需要将 TableView.BackgroundColor 设置为 UIColor.Clear

    【讨论】:

    • 嗨米格尔。感谢您的回复。实际上,我确实看到了我发布的问题的另一个答案,并尝试将 BackgroundColor 设置为 UIColor.Clear。但这并没有帮助。那时我得到的只是黑色背景。
    猜你喜欢
    • 2011-02-10
    • 1970-01-01
    • 2015-02-17
    • 2017-10-06
    • 1970-01-01
    • 1970-01-01
    • 2012-10-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多