当前位置: 首页 > news >正文

做网站的软件是是什么/成人职业技能培训学校

做网站的软件是是什么,成人职业技能培训学校,佛山免费建站怎样,同样是div 怎么有些网站收录少 有些多UIDeviceOrientation 是机器硬件的当前旋转方向 这个你只能取值 不能设置 UIInterfaceOrientation 是你程序界面的当前旋转方向 这个可以设置 //判断设备现在的方向: //C代码 收藏代码 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOri…

UIDeviceOrientation      是机器硬件的当前旋转方向   这个你只能取值 不能设置

UIInterfaceOrientation   是你程序界面的当前旋转方向   这个可以设置

 

//判断设备现在的方向:

//C代码  收藏代码

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

{

    //宣告一個UIDevice指標,並取得目前Device的狀況

    UIDevice *device = [UIDevice currentDevice] ;

    

    //取得當前Device的方向,來當作判斷敘述。(Device的方向型態為Integer)

    switch (device.orientation) {

        case UIDeviceOrientationFaceUp:

            NSLog(@"螢幕朝上平躺");

            break;

            

        case UIDeviceOrientationFaceDown:

            NSLog(@"螢幕朝下平躺");

            break;

            

            //系統無法判斷目前Device的方向,有可能是斜置

        case UIDeviceOrientationUnknown:

            NSLog(@"未知方向");

            break;

            

        case UIDeviceOrientationLandscapeLeft:

            NSLog(@"螢幕向左橫置");

            break;

            

        case UIDeviceOrientationLandscapeRight:

            NSLog(@"螢幕向右橫置");

            break;

            

        case UIDeviceOrientationPortrait:

            NSLog(@"螢幕直立");

            break;

            

        case UIDeviceOrientationPortraitUpsideDown:

            NSLog(@"螢幕直立,上下顛倒");

            break;

            

        default:

            NSLog(@"無法辨識");

            break;

    }

    

    // Return YES for supported orientations

    return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft); // 只支持向左横向, YES 表示支持所有方向

}

 

//或者

//C代码  收藏代码

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

{

    UIDeviceOrientation deviceOrientation = [UIDevice currentDevice].orientation;

    if (UIDeviceOrientationIsLandscape(deviceOrientation)) NSLog(@"横向");

    else if(UIDeviceOrientationIsPortrait(deviceOrientation)) NSLog(@"纵向");

    

    // // Return YES for supported orientations

    return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft); // 只支持向左横向, YES 表示支持所有方向

}

 

//Portrait 表示 纵向,Landscape 表示 横向。

 

//C代码  收藏代码

typedef enum {

    UIDeviceOrientationUnknown,

    UIDeviceOrientationPortrait,            // Device oriented vertically, home button on the bottom

    UIDeviceOrientationPortraitUpsideDown,  // Device oriented vertically, home button on the top

    UIDeviceOrientationLandscapeLeft,       // Device oriented horizontally, home button on the right

    UIDeviceOrientationLandscapeRight,      // Device oriented horizontally, home button on the left

    UIDeviceOrientationFaceUp,              // Device oriented flat, face up

    UIDeviceOrientationFaceDown             // Device oriented flat, face down

} UIDeviceOrientation;

 

//C代码  收藏代码

typedef enum {

    UIInterfaceOrientationPortrait           = UIDeviceOrientationPortrait,

    UIInterfaceOrientationPortraitUpsideDown = UIDeviceOrientationPortraitUpsideDown,

    UIInterfaceOrientationLandscapeLeft      = UIDeviceOrientationLandscapeRight,

    UIInterfaceOrientationLandscapeRight     = UIDeviceOrientationLandscapeLeft

} UIInterfaceOrientation;

 

//C代码  收藏代码

#define UIDeviceOrientationIsPortrait(orientation)  ((orientation) == UIDeviceOrientationPortrait || (orientation) == UIDeviceOrientationPortraitUpsideDown)

#define UIDeviceOrientationIsLandscape(orientation) ((orientation) == UIDeviceOrientationLandscapeLeft || (orientation) == UIDeviceOrientationLandscapeRight)

 

//上面是重要的源代码,已经解释的非常清楚。UIDeviceOrientationIsPortrait(orientation) 跟  ((orientation) == UIDeviceOrientationPortrait || (orientation) == UIDeviceOrientationPortraitUpsideDown) 完全是一个意思。

转载于:https://www.cnblogs.com/yhj1787354782/p/4980170.html

http://www.jmfq.cn/news/5088673.html

相关文章:

  • 宁波网站设计建站服务公司/好的推广平台
  • 电脑上制作网站的软件/网络营销策略是什么
  • 电子业网站建设/网站关键词优化教程
  • 自适应网站导航是怎么做的/外链互换平台
  • 做pc端的网站首页尺寸是多少/bt磁力王
  • 杭州政府网站建设/重庆seo关键词优化服务
  • wordpress rss静态化/seo优化怎么做
  • ubuntu vps wordpress/网站内部优化有哪些内容
  • 万万州州微微网站网站建建设设/手机关键词点击排名软件
  • 定州市住房和建设局网站/整站优化seo
  • 广东省建设工程执业中心网站/整合营销案例
  • 做律师事务所网站/百度广告费
  • 大型电子商务网站建设公司/网络热词2021流行语
  • 宝鸡做网站公司/北京优化推广公司
  • 自己建网站做外贸/seo和sem的区别
  • 发布网站需要备案/我想做网络推广找谁
  • 网站公众平台建设方案/seo优化一般多少钱
  • 黄埔b2b网站建设公司/全球最牛的搜索引擎
  • 江油建设局网站/seo推广策划
  • 网站浮动窗口怎么设置/网络营销策划推广公司
  • 网站建设技术方面/哪个平台可以接推广任务
  • 做网站的怎么获取客户信息/企业培训体系
  • 清华大学精品课程网站/达内教育
  • 香港即时新闻最新消息/搜索引擎seo关键词优化
  • 陕西营销型网站建设公司/互联网电商平台
  • 图书馆网站建设/昆山网站建设
  • 网站开发设计的技术/营销型网站和普通网站
  • 济宁网上做科目一的网站/怎么开网店新手入门
  • 东莞市住房建设局网站/怎么创建自己的网站平台
  • vps做电影网站/seo工作职位