public void UpdateLayout() { var width = (int)AndroidContext.ToPixels(Element.Width); var height = (int)AndroidContext.ToPixels(Element.Height); _flyoutRenderer.AndroidView.Layout(0, 0, width, height); }
public CustomCellView(Context context, Cell cell) : base(context, cell) { RemoveHint(); RemoveCellValueStack(); _AccessoryStack = AccessoryStack(); Container = new FormsViewContainer(AndroidContext, _CustomCell); this.Add(Container, 2, 0, GridSpec.Fill, GridSpec.Fill, Extensions.Layout.Match ); if (!_CustomCell.ShowArrowIndicator) { // TODO: implement ShowArrowIndicator (_IndicatorView) _AccessoryStack } if (!_CustomCell.UseFullSize) { return; } _Icon.RemoveFromParent(); _Title.RemoveFromParent(); _Description.RemoveFromParent(); var rMargin = (int)(_CustomCell.ShowArrowIndicator ? AndroidContext.ToPixels(10) : 0); Container.SetPadding(0, 0, rMargin, 0); _CellLayout.SetPadding(0, 0, 0, 0); }
void OnElementSizeChanged(object sender, EventArgs e) { int width = (int)AndroidContext.ToPixels(Element.Width); int height = (int)AndroidContext.ToPixels(Element.Height); _flyoutRenderer.AndroidView.Measure(MeasureSpecFactory.MakeMeasureSpec(width, MeasureSpecMode.Exactly), MeasureSpecFactory.MakeMeasureSpec(height, MeasureSpecMode.Exactly)); _flyoutRenderer.AndroidView.Layout(0, 0, width, height); }
void OnElementSizeChanged(object sender, EventArgs e) { Profile.FrameBegin(); Profile.FramePartition("ToPixels"); int width = (int)AndroidContext.ToPixels(Element.Width); int height = (int)AndroidContext.ToPixels(Element.Height); Profile.FramePartition("Measure"); _flyoutRenderer.AndroidView.Measure(MeasureSpecFactory.MakeMeasureSpec(width, MeasureSpecMode.Exactly), MeasureSpecFactory.MakeMeasureSpec(height, MeasureSpecMode.Exactly)); Profile.FramePartition("Layout"); _flyoutRenderer.AndroidView.Layout(0, 0, width, height); Profile.FrameEnd(); }