2012-03-20 46 views
1

我有一个RootElement节。一节有RadioElements。如何更改子部分的BackgroundView?MonoTouch.Dialog:Sub Section BackgroundView?

像这样的东西不起作用,因为副视点尚未创建:

 rootGroups = new RootElement ("Ideas", rdoGroup) { 
      new RootElement ("Baha'i") { 
       new Section(){ 
        new RadioElement ("Peace"), 
        new RadioElement ("Unity"), 
        new RadioElement ("Science")  
       } 
      } 
     }; 

??? 
rootGroups.TableView.BackgroundColor = ...; 

回答

2

如果你想创建两个不同背景的两种不同的观点,你必须创建另一个dialogViewController第二根这样你就可以改变背景。

要做到这一点,不是使用常规的RootElement构造函数,而是使用RootElement构造函数,该构造函数接受可根据需要创建UIViewController的委托方法。