Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 1st, 2012  |  syntax: None  |  size: 1.85 KB  |  hits: 21  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Add MonoTouch.Dialog on PopOverView
  2. [Register("MyCustomPopoverViewController")]
  3. public partial class MyCustomPopoverViewController : UIViewController
  4. {
  5.     DetailViewController appd;
  6.  
  7.     public MyCustomPopoverViewController (DetailViewController app)
  8.     {
  9.         appd = app;
  10.     }
  11.  
  12.     public override void ViewDidLoad ()
  13.     {
  14.         Console.WriteLine ("Paged view did load");
  15.         this.ContentSizeForViewInPopover = new SizeF (370, 670);
  16.  
  17.         var root = new RootElement ("Meals"){
  18.         new Section ("Dinner"){
  19.                 new RootElement ("Desert", new RadioGroup ("desert", 2)){
  20.                     new Section (){
  21.                     new RadioElement ("Ice Cream", "desert"),
  22.                     new RadioElement ("Ice Cream", "desert"),
  23.                     new RadioElement ("Ice Cream", "desert"),
  24.                     new RadioElement ("Ice Cream", "desert"),
  25.                     new RadioElement ("Ice Cream", "desert")
  26.                     }
  27.                 }
  28.             }      
  29.         };
  30.     }  
  31. }
  32.        
  33. public override void ViewDidLoad ()
  34.     {
  35.         Console.WriteLine ("Paged view did load");
  36.         this.ContentSizeForViewInPopover = new SizeF (370, 670);
  37.  
  38.         var root = new RootElement ("Meals"){
  39.         new Section ("Dinner"){
  40.                 new RootElement ("Desert", new RadioGroup ("desert", 2)){
  41.                     new Section (){
  42.                     new RadioElement ("Ice Cream", "desert"),
  43.                     new RadioElement ("Ice Cream", "desert"),
  44.                     new RadioElement ("Ice Cream", "desert"),
  45.                     new RadioElement ("Ice Cream", "desert"),
  46.                     new RadioElement ("Ice Cream", "desert")
  47.                     }
  48.                 }
  49.             }      
  50.         };
  51.                     // This is the solution!
  52.         var dv = new DialogViewController (root);
  53.         View.Add(dv.View);
  54.     }