Bor*_*gge 1 background-color xamarin.ios ipad ios monotouch.dialog
环境:使用Monotouch和Monotouch.Dialog库创建iPad应用程序.
我一直试图在DialogViewController上设置背景颜色无济于事.我的应用程序中有多个视图正在加载卸载.对于非他们我设法设置背景颜色.
到目前为止我尝试了什么:
但是只要我加载DialogViewController(带有关联的视图),背景颜色总是灰色的.DialogViewController用于Monotouch.Dialog框架.
我正在将DialogViewController推到导航控制器上,以显示在表格视图中布置的一组按钮.
我必须错过一些基本的东西!我一直在浏览Monotouch.Dialog代码,并尝试了其他一些东西,但到目前为止还没有解决我的问题.
任何帮助高度赞赏.
鲍里斯
Eri*_*der 14
实际上,您需要将背景视图设置为null.这是表视图后面的视图,例如MonoTouch.Dialog中的分组视图
以下是此类的子类:
using System;
using System.Drawing;
using System.IO;
using MonoTouch.Foundation;
using MonoTouch.CoreGraphics;
using MonoTouch.Dialog;
using MonoTouch.UIKit;
namespace MyNameSpace{
public class MySpecialDialogViewController : DialogViewController {
public MySpecialDialogViewController (UITableViewStyle style, RootElement root)
: base (style, root)
{
}
public override void LoadView ()
{
base.LoadView ();
TableView.BackgroundView = null;
TableView.BackgroundColor = UIColor.Black;
}
}
}
Run Code Online (Sandbox Code Playgroud)
"MonoTouch.Dialog"文档中的"自定义DialogViewController"一节对此进行了描述.
你需要继承DialogViewController,如下所示:
public class ColoredViewController : DialogViewController {
[...]
public override LoadView ()
{
base.LoadView ();
TableView.BackgroundColor = UIColor.Clear;
ParentViewController.View.BackgroundColor = UIColor.Red;
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3937 次 |
| 最近记录: |