Пример #1
0
		/// <summary>
		/// Initializes a new instance of the <see cref="XibFree.UILayoutHostScrollable"/> class.
		/// </summary>
		/// <param name="layout">Root of the view hierarchy to be hosted by this layout host</param>
		public UILayoutHostScrollable(ViewGroup layout, CGRect frame) : base(frame)
		{
			_layoutHost = new UILayoutHost(layout);
			_layoutHost.AutoresizingMask = UIViewAutoresizing.None;
			this.AutoresizingMask = UIViewAutoresizing.FlexibleDimensions;
			this.AddSubview(_layoutHost);
		}
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="XibFree.UILayoutHostScrollable"/> class.
        /// </summary>
        /// <param name="layout">Root of the view hierarchy to be hosted by this layout host</param>
        public UILayoutHostScrollable(ViewGroup layout, RectangleF frame)
            : base(frame)
        {
            _layoutHost = new UILayoutHost(layout);
            _layoutHost.Container = this; // make sure the child layouthost knowns about this special construction.

            _layoutHost.AutoresizingMask = UIViewAutoresizing.None;
            this.AutoresizingMask = UIViewAutoresizing.FlexibleDimensions;
            this.AddSubview(_layoutHost);
        }
Пример #3
0
 public UILayoutHost(ViewGroup layout)
 {
     this.AutoresizingMask = UIViewAutoresizing.FlexibleDimensions;
     Layout = layout;
 }
Пример #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="XibFree.UILayoutHost"/> class.
 /// </summary>
 /// <param name="layout">Root of the view hierarchy to be hosted by this layout host</param>
 public UILayoutHost(ViewGroup layout, RectangleF frame)
     : base(frame)
 {
     this.AutoresizingMask = UIViewAutoresizing.FlexibleDimensions;
     Layout = layout;
 }
Пример #5
0
            public DemoTableViewCell()
                : base(UITableViewCellStyle.Default, "DemoTableViewCell")
            {
                _layout = new LinearLayout(Orientation.Horizontal)
                {
                    Padding = new UIEdgeInsets(5,5,5,5),
                    LayoutParameters = new LayoutParameters()
                    {
                        Width = AutoSize.FillParent,
                        Height = AutoSize.WrapContent,
                    },
                    SubViews = new View[]
                    {
                        new NativeView()
                        {
                            View = new UIImageView(CGRect.Empty)
                            {
                                Image = UIImage.FromBundle("tts512.png"),
                            },
                            LayoutParameters = new LayoutParameters()
                            {
                                Width = 40,
                                Height = 40,
                                Margins = new UIEdgeInsets(0,0,0,10),
                            }
                        },
                        new LinearLayout(Orientation.Vertical)
                        {
                            LayoutParameters = new LayoutParameters()
                            {
                                Width = AutoSize.FillParent,
                                Height = AutoSize.WrapContent,
                            },
                            SubViews = new View[]
                            {
                                new NativeView()
                                {
                                    View = _labelTitle = new UILabel()
                                    {
                                        BackgroundColor = UIColor.Clear,
                                        Font = UIFont.BoldSystemFontOfSize(18),
                                        HighlightedTextColor = UIColor.White,
                                    },
                                    LayoutParameters = new LayoutParameters()
                                    {
                                        Width = AutoSize.FillParent,
                                        Height = AutoSize.WrapContent,
                                    }
                                },
                                new NativeView()
                                {
                                    View = _labelSubTitle = new UILabel()
                                    {
                                        BackgroundColor = UIColor.Clear,
                                        Font = UIFont.SystemFontOfSize(12),
                                        TextColor = UIColor.DarkGray,
                                        HighlightedTextColor = UIColor.White,
                                    },
                                    LayoutParameters = new LayoutParameters()
                                    {
                                        Width = AutoSize.FillParent,
                                        Height = AutoSize.WrapContent,
                                    }
                                },
                            }
                        },
                        new NativeView()
                        {
                            View = _labelPercent = new UILabel()
                            {
                                BackgroundColor = UIColor.Clear,
                                TextColor = UIColor.FromRGB(51,102,153),
                                HighlightedTextColor = UIColor.White,
                                Font = UIFont.BoldSystemFontOfSize(24),
                                TextAlignment = UITextAlignment.Right,
                            },
                            LayoutParameters = new LayoutParameters()
                            {
                                Width = 50,
                                Height = AutoSize.FillParent,
                                Margins = new UIEdgeInsets(0, 10, 0, 0),
                            }
                        }
                    }
                };

                this.ContentView.Add(new UILayoutHost(_layout, this.ContentView.Bounds));
                this.Accessory = UITableViewCellAccessory.DisclosureIndicator;
            }
Пример #6
0
		public UILayoutHostScrollable(ViewGroup layout) : this(layout, CGRect.Empty)
		{
		}
Пример #7
0
 public UILayoutHostScrollable(ViewGroup layout)
     : this(layout, RectangleF.Empty)
 {
 }