zoukankan      html  css  js  c++  java
  • 关于屏幕旋转的几种情况

    一、设备旋转(上苹果商店有风险)

    *这种方法当在General中勾选了Device Orieation 的Protrait后再用下面代码不能设置屏幕旋转至横屏。

    if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) {

        [[UIDevice currentDevice] performSelector:@selector(setOrientation:)

    withObject:(id)UIInterfaceOrientationPortrait];

    }

    二、视图旋转(假旋转,将当前视图旋转)

    //AppCan应用引擎里边将Config.xml的属性设置为5,仅竖屏显示。<orientation>5</orientation>,将视图旋转至横屏状态,重新设置当前视图bounds值。

     [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait];

         UIImageView * imagev = (UIImageView*)meBrwView;

         imagev.transform = CGAffineTransformMakeRotation(M_PI*2);

        CGRect frame = [UIScreen mainScreen].applicationFrame;

        NSLog(@"%f,%f,%f,%f",frame.origin.x,frame.origin.y,frame.size.height,frame.size.width);

        imagev.bounds = CGRectMake(0, 0, frame.size.width, frame.size.height);

  • 相关阅读:
    POJ
    CodeForces
    51Nod 1256 扩展欧几里得求乘法逆元
    SDUT 3917
    SDUT 3918
    从零开始实现asp.net MVC4框架网站的用户登录以及权限验证模块 详细教程
    bootstrap资料索引
    理解Login函数
    细说@Html.ActionLink()的用法
    RGB颜色对照表
  • 原文地址:https://www.cnblogs.com/hanyutong/p/4524090.html
Copyright © 2011-2022 走看看