Example #1
0
        public GridView(RectangleF rect) : base(rect)
        {
            this.BackgroundColor = UIColor.Gray;
            // pass in Number of collumns/rows
            grid = new UIGrid(this.Frame, 6, 10);

            //pass in collumn/row width/height
            //grid = new UIGrid(this.Frame,30f,30f);

            textInput = new XamlControls.UITextField()
            {
                BackgroundColor = UIColor.White
            };

            label = new XamlControls.UILabel {
                Text = "label 1"
            };
            imageView = new XamlControls.UIImageView(Images.Featured);

            this.AddSubview(grid);

            UIGrid.SetColumn(textInput, 4);
            UIGrid.SetColumnSpan(textInput, 3);

            UIGrid.SetRow(textInput, 1);
            UIGrid.SetRowSpan(textInput, 1);

            UIGrid.SetColumn(label, 1);
            UIGrid.SetColumnSpan(label, 3);
            UIGrid.SetRow(label, 1);
            UIGrid.SetRowSpan(label, 1);

            UIGrid.SetColumn(imageView, 1);
            UIGrid.SetColumnSpan(imageView, 6);
            UIGrid.SetRow(imageView, 2);
            UIGrid.SetRowSpan(imageView, 6);

            grid.AddSubview(textInput);
            grid.AddSubview(label);
            grid.AddSubview(imageView);
        }