开发者

MonoTouch.Dialog: iPad not getting background Image set

开发者 https://www.devze.com 2023-04-05 06:23 出处:网络
using MonoTouch.Dialog I create a simple ViewController: In the LoadView I set the background image. This works in iPhone, but not in iPad. There is nothing else to the app at this point:

using MonoTouch.Dialog I create a simple ViewController:

In the LoadView I set the background image. This works in iPhone, but not in iPad. There is nothing else to the app at this point:

public override void LoadView ()
{
    base.LoadView ();
    var color = UIColor.FromPatte开发者_如何学PythonrnImage (image);
    TableView.BackgroundColor = UIColor.Clear;
    ParentViewController.View.BackgroundColor = color;
}

is there a reason why iPads don't get their background set?


To set the background image of a UITableView in MonoTouch.Dialog on an iPad:

TableView.BackgroundView = 
     new UIView(ParentViewController.View.Frame) 
         {BackgroundColor = color};

where color is an UIColor image

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号