zoukankan      html  css  js  c++  java
  • 获取设备的方向

    1.手机朝向的枚举

    typedef NS_ENUM(NSInteger, UIDeviceOrientation) {

        UIDeviceOrientationUnknown,

        UIDeviceOrientationPortrait,            // 设备面向垂直,home 按钮在底部

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

        UIDeviceOrientationLandscapeLeft,       // 设备面向垂直,home 按钮在顶部

        UIDeviceOrientationLandscapeRight,      // 设备水平,面向 home 按钮在左边

        UIDeviceOrientationFaceUp,              // 设备平,面向脸了

        UIDeviceOrientationFaceDown             // 设备平,面向的脸

    } __TVOS_PROHIBITED;

    2.可以使用switch来记录设备的方向

    获取设备方向的枚举值

    [[UIDevice currentDevice] orientation]

    switch ([[UIDevice currentDevice] orientation])

        {

            case UIDeviceOrientationPortraitUpsideDown:

                break;

            case UIDeviceOrientationLandscapeLeft:

                break;

            case UIDeviceOrientationLandscapeRight:

                break;

            case UIDeviceOrientationFaceUp:

            default:

                break;

        }

  • 相关阅读:
    luogu_1168: 中位数
    luogu_4762: [CERC2014]Virus synthesis
    luogu_4287:双倍回文
    回文自动机学习笔记
    luogu_3645: 雅加达的摩天楼
    python爬今日头条(ajax分析)
    Python多进程multiprocessing.Pool()
    Python爬微博(ajax+mongo)
    python实用函数之join()
    python之tuple与list
  • 原文地址:https://www.cnblogs.com/chaoyueME/p/6247708.html
Copyright © 2011-2022 走看看