码迷,mamicode.com
首页 > 移动开发 > 详细

Xamarin.ios 重新定位视图

时间:2017-01-04 10:29:55      阅读:224      评论:0      收藏:0      [点我收藏+]

标签:rectangle   style   旋转   des   xamarin   bsp   override   ide   ati   

//旋转手机重新定位视图
/// <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);
            }
        } 

 

Xamarin.ios 重新定位视图

标签:rectangle   style   旋转   des   xamarin   bsp   override   ide   ati   

原文地址:http://www.cnblogs.com/IKang8701348/p/6247467.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!