/// <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.AutoresizingMask = UIViewAutoresizing.None;
     this.AutoresizingMask        = UIViewAutoresizing.FlexibleDimensions;
     this.AddSubview(_layoutHost);
 }
		/// <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);
		}
Exemple #3
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);
        }
        /// <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);
        }
Exemple #5
0
 public CustomButton(string title)
 {
     _host = new UILayoutHost()
     {
         Layout = new LinearLayout(Orientation.Horizontal)
         {
             Padding = new UIEdgeInsets(3, 2, 3, 5),
             LayoutParameters = new LayoutParameters(AutoSize.WrapContent, 56)
             {
             },
             SubViews = new[]
             {
                 new NativeView()
                 {
                     LayoutParameters = new LayoutParameters(30, 30),
                     View = new UIView() { BackgroundColor = UIColor.Red },
                 },
                 new NativeView()
                 {
                     LayoutParameters = new LayoutParameters(AutoSize.WrapContent, AutoSize.FillParent)
                     {
                         MarginLeft = 4,
                         MarginRight = 2,
                         Gravity = Gravity.CenterVertical,
                         MaxWidth = 90,
                     },
                     View = new UILabel() { Text = title, Lines = 0 },
                 },
             }
         },
     };
     AddSubview(_host);
 }