Ian Vink
Ian Vink

Reputation: 68780

MonoTouch.Dialog: Sub Section BackgroundView?

I have a RootElement with Sections. One section has RadioElements. How do I change the BackgroundView on the sub section?

Something like this doesn't work because the sub view isn't yet created.:

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

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

Upvotes: 1

Views: 170

Answers (1)

Janub
Janub

Reputation: 1604

If you want to create two different view with two different background you must create another dialogViewController for the second root, that way you will be able to change the background.

To do this, instead of using a regular RootElement constructor, use the RootElement constructor that takes a delegate method that can create the UIViewController on demand.

Upvotes: 2

Related Questions