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);

  • 相关阅读:
    软件上线标准
    rap使用手册
    微服务
    什么是集合?
    什么是maven?maven中的pom文件是做什么的?
    什么是连接池?
    架构
    什么是反射?
    产品
    描述下fastJSON,jackson等等的技术
  • 原文地址:https://www.cnblogs.com/hanyutong/p/4524090.html
Copyright © 2011-2022 走看看