Пример #1
0
        public void LayoutView(int l, int t, int r, int b)
        {
            NativeView.Layout(l, t, r, b);

            //if (width == -1)
            //	width = double.PositiveInfinity;

            //if (height == -1)
            //	height = double.PositiveInfinity;

            //Width = width;
            //Height = height;
            //MaxWidth = maxWidth;
            //MaxHeight = maxHeight;
            //X = x;
            //Y = y;

            //Context context;

            //if (Handler == null || !(_context.TryGetTarget(out context)) || !NativeView.IsAlive())
            //	return;

            //if (View == null)
            //{
            //	MauiView.Measure(0, 0);
            //	MauiView.Arrange(Rectangle.Zero);
            //	return;
            //}

            //var request = MauiView.Measure(width, height);

            //var layoutParams = NativeView.LayoutParameters;
            //if (double.IsInfinity(height))
            //	height = request.Height;

            //if (double.IsInfinity(width))
            //	width = request.Width;

            //if (height > maxHeight)
            //	height = maxHeight.Value;

            //if (width > maxWidth)
            //	width = maxWidth.Value;

            //if (layoutParams.Width != LP.MatchParent)
            //	layoutParams.Width = (int)context.ToPixels(width);

            //if (layoutParams.Height != LP.MatchParent)
            //	layoutParams.Height = (int)context.ToPixels(height);

            //NativeView.LayoutParameters = layoutParams;
            //var c = NativeView.Context;
            //var l = (int)c.ToPixels(x);
            //var t = (int)c.ToPixels(y);
            //var r = (int)c.ToPixels(width) + l;
            //var b = (int)c.ToPixels(height) + t;

            //NativeView.Layout(l, t, r, b);
        }