我需要一種方式來設置Monotouch對話框的樣式RootElement。我需要更改背景和字體顏色。我如何樣式RootElement
我已經創建了一個自定義的rootElement的如下
public class ActivityRootElement : RootElement
{
public ActivityRootElement (string caption) : base (caption)
{
}
public ActivityRootElement(string caption, Func<RootElement, UIViewController> createOnSelected) : base (caption, createOnSelected)
{
}
public ActivityRootElement(string caption, int section, int element) : base (caption, section, element)
{
}
public ActivityRootElement(string caption, Group group) : base (caption, group)
{
}
public override UITableViewCell GetCell (UITableView tv)
{
tv.BackgroundColor = Settings.RootBackgroundColour;
return base.GetCell (tv);
}
protected override void PrepareDialogViewController(UIViewController dvc)
{
dvc.View.BackgroundColor = Settings.RootBackgroundColour;
base.PrepareDialogViewController(dvc);
}
}
我然後調用自定義的根元素,如下傳遞一個自定義的DialogController
section.Add (new ActivityRootElement(activity.Name, (RootElement e) => {
return new ActivityHistoryDialogViewController (e,true);
}));
根元素風格不被應用。任何幫助將apprciated!
這個問題越來越老了,但是你是否得到了這個工作? – Halvard