コード例 #1
0
        public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
        {
            UITableViewController nextController = null;

            switch (indexPath.Row)
            {
                case 0:
                    nextController = new CheckmarkDemoTableController(UITableViewStyle.Grouped);
                    break;
                case 1:
                    nextController = new StyleDemoTableController(UITableViewStyle.Grouped);
                    break;
                case 2:
                    nextController = new EditableTableController(UITableViewStyle.Plain);
                    break;
                default:
                    break;
            }

            if (nextController != null)
                _controller.NavigationController.PushViewController(nextController,true);
        }
コード例 #2
0
 public CheckmarkDemoTableDelegate(CheckmarkDemoTableController controller)
 {
     _controller = controller;
     _previousRow = NSIndexPath.FromRowSection(Settings.SelectedIndex,0);
 }
コード例 #3
0
 public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
 {
     UITableViewController nextController = new CheckmarkDemoTableController(UITableViewStyle.Grouped);
     _controller.NavigationController.PushViewController(nextController,true);
 }
コード例 #4
0
        private void InitAdvanced()
        {
            // Single image
            StyleItem item1 = new StyleItem("Image","",UITableViewCellStyle.Default,UITableViewCellAccessory.None);
            item1.Image = UIImage.FromFile("bulb_on.png");

            //
            // Two images
            //
            StyleItem item2 = new StyleItem("Two images","",UITableViewCellStyle.Default,UITableViewCellAccessory.DisclosureIndicator);
            item2.Image = UIImage.FromFile("bulb_on.png");

            // This is the easiest way to set the right image if you don't want to trap it being clicked in the delegate
            UIImageView imageView = new UIImageView(UIImage.FromFile("bulb_off.png"),UIImage.FromFile("bulb_off.png"));
            item2.AccessoryView = imageView;

            // If you want to trap AccessoryButtonTapped in the delegate, you need to use a UIButton
            UIButton button = UIButton.FromType(UIButtonType.Custom);
            button.TouchDown += delegate {
                UITableViewController nextController = new CheckmarkDemoTableController(UITableViewStyle.Grouped);
                _parentController.NavigationController.PushViewController(nextController,true);
            };

            button.SetBackgroundImage(UIImage.FromFile("bulb_off.png"),UIControlState.Normal);
            button.SetBackgroundImage(UIImage.FromFile("bulb_off.png"),UIControlState.Selected);
            button.Frame = new System.Drawing.RectangleF(0,0,26,26);
            item2.AccessoryView = button;

            //
            // Two images + custom control
            //
            StyleItem item3 = new StyleItem("","",UITableViewCellStyle.Default,UITableViewCellAccessory.DisclosureIndicator);
            item3.Image = UIImage.FromFile("bulb_on.png");

            UISlider slider = new UISlider();
            slider.MaxValue = 100f;
            slider.Value = 50f;
            slider.MinValue = 0f;
            slider.Frame = new RectangleF(50,9,215,23);
            item3.ContentView = slider;

            UIImageView imageView1 = new UIImageView(UIImage.FromFile("bulb_off.png"),UIImage.FromFile("bulb_off.png"));
            item3.AccessoryView = imageView1;

            // A switcher
            StyleItem item4 = new StyleItem("Free beer?","",UITableViewCellStyle.Default,UITableViewCellAccessory.None);
            UISwitch switcher = new UISwitch();
            item4.AccessoryView = switcher;

            _items.Add(item1);
            _items.Add(item2);
            _items.Add(item3);
            _items.Add(item4);
        }