Exemplo n.º 1
0
        //You can also use View and other wrapper structs here since all of them
        //implicitly cnverted to PlatformView subclasses
        public View AddSubview(PlatformView child)
        {
#if __IOS__
            PlatformView.AddSubview(child);
#endif
#if __ANDROID__
            var view = PlatformView as PlatformViewGroup;
            if (view == null)
            {
                throw new InvalidOperationException("PlatformView is not ViewGroup");
            }
            if (child.Parent != null)
            {
                child.AsView().RemoveFromSuperview();
            }
            view.AddView(child);
#endif
            return(this);
        }