Xamarin.ios 重新定位视图

//旋转手机重新定位视图
/// <summary> 
        /// 重新定位视图
        /// </summary>
        /// <param name="toInterfaceOrientation">To interface orientation.</param>
        /// <param name="duration">Duration.</param>
        public override void WillRotate(UIInterfaceOrientation toInterfaceOrientation, double duration)
        {
            UIInterfaceOrientation destOrientation = toInterfaceOrientation;
            //判断选择方向
            if (destOrientation == UIInterfaceOrientation.LandscapeLeft | destOrientation == UIInterfaceOrientation.LandscapeRight)
            {
                vv.Frame = new RectangleF(0, 0, 667, 375);
            }
            else { 
            
                vv.Frame = new RectangleF(0, 0,  375,667);
            }
        } 

 

posted @ 2017-01-04 09:51  iZKang  阅读(293)  评论(0编辑  收藏  举报