示例#1
0
        public IXFPopupCtrl CreateDropDown(View anchor, View drop)
        {
            CustomDropDown dlg = null;

            var render = Convert(drop, anchor);

            if (render != null)
            {
                var nanchor = anchor.GetRenderer() as Canvas;
                drop.WidthRequest = nanchor.ActualWidth;

                if (drop.HeightRequest <= 0)
                {
                    var size = drop.GetSizeRequest(nanchor.ActualWidth, XFPopupConst.SCREEN_HEIGHT / 2);
                    if (size.Request.Height > XFPopupConst.SCREEN_HEIGHT / 2)
                    {
                        drop.HeightRequest = XFPopupConst.SCREEN_HEIGHT / 2;
                    }
                    else
                    {
                        drop.HeightRequest = size.Request.Height;
                    }
                }

                drop.Layout(new Rectangle(0, 0, drop.WidthRequest, drop.HeightRequest));

                dlg = new CustomDropDown(nanchor, render as Canvas, drop.HeightRequest);
            }



            return(dlg);
        }
示例#2
0
        public IXFPopupCtrl CreateDropDown(View anchor, View drop)
        {
            CustomDropDown dlg = null;

            var render = Convert(drop, anchor);

            if (render != null)
            {
                var nanchor = anchor.GetRenderer() as Canvas;
                drop.WidthRequest = nanchor.ActualWidth;

                if (drop.HeightRequest <= 0)
                {
                    var size = drop.GetSizeRequest(nanchor.ActualWidth, XFPopupConst.SCREEN_HEIGHT / 2);
                    if (size.Request.Height > XFPopupConst.SCREEN_HEIGHT / 2)
                    {
                        drop.HeightRequest = XFPopupConst.SCREEN_HEIGHT / 2;
                    }
                    else
                    {
                        drop.HeightRequest = size.Request.Height;
                    }
                }

                drop.Layout(new Rectangle(0, 0, drop.WidthRequest, drop.HeightRequest));

                dlg = new CustomDropDown(nanchor, render as Canvas, drop.HeightRequest);
            }

            return dlg;
        }