首页 编程 软件学院 查看内容

ios之获取当前系统版本/UUID标识/名字/型号

2014-11-18 12:01 961 0

摘要: 1.识别当前系统版本,由于ios7 的statusBar 是悬空的,所以需要做下适配这样会避免屏幕下面出现白条,针对不同的版本显示内容布局不同[objc] view plaincopy<...
关键词: nbsp nonatomic property readonly NSString retain orientation UIDeviceOrientat systemVersion stateHeight

1.识别当前系统版本,由于ios7 的statusBar 是悬空的,所以需要做下适配这样会避免屏幕下面出现白条,针对不同的版本显示内容布局不同[objc] view plaincopy<pre name="code" class="objc">        int stateHeight = 0;          if ([UIDevice currentDevice].systemVersion.intValue>=7) {              stateHeight = 20;          }  2. UIDevice 点开这个类里面还有其他系统信息可以获取与上面方法类似但不常用,通过单例来实现 来看看一下属性[objc] view plaincopy@property(nonatomic,readonly,retain) NSString    *name;              // e.g. "My iPhone"  @property(nonatomic,readonly,retain) NSString    *model;             // e.g. @"iPhone", @"iPod touch"  @property(nonatomic,readonly,retain) NSString    *localizedModel;    // localized version of model  @property(nonatomic,readonly,retain) NSString    *systemName;        // e.g. @"iOS"  @property(nonatomic,readonly,retain) NSString    *systemVersion;     // e.g. @"4.0"  @property(nonatomic,readonly) UIDeviceOrientation orientation;       // return current device orientation.  this will return UIDeviceOrientationUnknown unless device orientation notifications are being generated.  
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系 [邮箱地址] 删除

路过

雷人

握手

鲜花

鸡蛋

最新评论

返回顶部