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

  • 相关阅读:
    不同用户表的导入导出
    视图合并和谓词推入
    pgsql 的函数
    pgsql_pg的数据类型
    个人最终总结
    结对编程黄金点游戏
    阅读代码
    Visual Studio2015安装过程以及单元测试
    软件工程(2018)第五次团队作业
    软件工程(2018)第二次团队作业
  • 原文地址:https://www.cnblogs.com/hanyutong/p/4524090.html
Copyright © 2011-2022 走看看