コード例 #1
0
        public override void LayoutSubviews()
        {
            double containerPadding = Width / 20;

            double x = containerPadding;
            double y = containerPadding;
            double w = Width - 2 * containerPadding;
            double h = Height - 2 * containerPadding;

            AddSubview(container, x, y, w, h);

            double imagePadding = container.Width / 5;
            double textPadding  = container.Width / 20;

            x = imagePadding;

            y = textPadding;             // doesn't need that much y
            w = Width - 2 * imagePadding;
            h = w;

            container.AddSubview(image, x, y, w, h);

            y += h + textPadding;

            x = 0;
            h = Height - (h + textPadding);
            w = container.Width;

            container.AddSubview(text, x, y, w, h);
        }
コード例 #2
0
 public override void AddSubview(View view)
 {
     if (IsNavigationBarVisible)
     {
         container.AddSubview(view);
     }
     else
     {
         base.AddSubview(view);
     }
 }
コード例 #3
0
        public override void LayoutSubviews()
        {
            base.LayoutSubviews();

            double padding = 5;

            AddSubview(container, padding, padding, Width - 2 * padding, Height - 2 * padding);

            double titleHeight = container.Height / 5;

            double x = padding;
            double y = 0;
            double w = container.Width - 2 * padding;
            double h = titleHeight;

            container.AddSubview(titleLabel, x, y, w, h);

            double separatorW = container.Width / 4 * 3;

            x = container.Width / 2 - separatorW / 2;
            y = h - 2;
            w = separatorW;
            h = 1;

            container.AddSubview(separator, x, y, w, h);

            double itemSize    = container.Height - (titleHeight + 2 * padding);
            double itemPadding = 10;

            // PickerViewItem count
            int count = 2;

            h = itemSize;
            w = itemSize;
            x = container.Width - (count * itemSize + count * itemPadding);
            y = titleHeight + padding;

            container.AddSubview(Github, x, y, w, h);

            x += itemSize + itemPadding;

            container.AddSubview(Drive, x, y, w, h);
        }
コード例 #4
0
        public static BaseView GetHeaderLabel(string text)
        {
            BaseView view = new BaseView();

            view.ClearChildrenOnLayout = false;

            Label label = new Label();

            label.Text = text;
            label.VerticalTextAlignment = TextAlignment.End;
            label.TextColor             = Color.Black;
            label.Margin         = new Thickness(0, 0);
            label.FontAttributes = FontAttributes.Bold;
            label.FontSize       = 15f;

            view.AddSubview(label, 0, 0, BaseView.MatchParent, BaseView.MatchParent);

            return(view);
        }
コード例 #5
0
 public void AddSubview(View view)
 {
     content.AddSubview(view);
 }
コード例 #6
0
 public void Add(BaseView parent, double width)
 {
     parent.AddSubview(parent, 0, BaseY, width, Height);
 }