/// <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); }
/// <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); }
public UILayoutHost(ViewGroup layout) { this.AutoresizingMask = UIViewAutoresizing.FlexibleDimensions; Layout = layout; }
/// <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; }
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; }
public UILayoutHostScrollable(ViewGroup layout) : this(layout, CGRect.Empty) { }
public UILayoutHostScrollable(ViewGroup layout) : this(layout, RectangleF.Empty) { }