UIDevice-b
typedef NS_ENUM(NSInteger, UIDeviceOrientation) //设备方向
{
UIDeviceOrientationUnknown,
UIDeviceOrientationPortrait, // 竖向,头向上
UIDeviceOrientationPortraitUpsideDown, // 竖向,头向下
UIDeviceOrientationLandscapeLeft, // 横向,头向左
UIDeviceOrientationLandscapeRight, // 横向,头向右
UIDeviceOrientationFaceUp, // 平放,屏幕朝下
UIDeviceOrientationFaceDown // 平放,屏幕朝下
};
typedef NS_ENUM(NSInteger, UIDeviceBatteryState) //电池状态
{
UIDeviceBatteryStateUnknown,
UIDeviceBatteryStateUnplugged, // 未充电
UIDeviceBatteryStateCharging, // 正在充电
UIDeviceBatteryStateFull, // 满电
};
typedef NS_ENUM(NSInteger, UIUserInterfaceIdiom) //用户界面类型
{
//iOS3.2以上有效
#if __IPHONE_3_2 <= __IPHONE_OS_VERSION_MAX_ALLOWED
UIUserInterfaceIdiomPhone, // iPhone 和 iPod touch 风格
UIUserInterfaceIdiomPad, // iPad 风格
#endif
};
#define UI_USER_INTERFACE_IDIOM() ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)] ? [[UIDevice currentDevice] userInterfaceIdiom] : UIUserInterfaceIdiomPhone)
#define UIDeviceOrientationIsPortrait(orientation) ((orientation) == UIDeviceOrientationPortrait || (orientation) == UIDeviceOrientationPortraitUpsideDown)
#define UIDeviceOrientationIsLandscape(orientation) ((orientation) == UIDeviceOrientationLandscapeLeft || (orientation) == UIDeviceOrientationLandscapeRight)
NS_CLASS_AVAILABLE_IOS(2_0) @interface UIDevice : NSObject {
@private
NSInteger _numDeviceOrientationObservers;
float _batteryLevel;
struct {
unsigned int batteryMonitoringEnabled:1;
unsigned int proximityMonitoringEnabled:1;
unsigned int expectsFaceContactInLandscape:1;
unsigned int orientation:3;
unsigned int batteryState:2;
unsigned int proximityState:1;
} _deviceFlags;
}
+ (UIDevice *)currentDevice; // 获取当前设备
@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; // 除非正在生成设备方向的通知,否则返回UIDeviceOrientationUnknown 。
@property(nonatomic,readonly,retain) NSUUID *identifierForVendor NS_AVAILABLE_IOS(6_0); // 可用于唯一标识该设备,同一供应商不同应用具有相同的UUID 。
@property(nonatomic,readonly,getter=isGeneratingDeviceOrientationNotifications) BOOL generatesDeviceOrientationNotifications; //是否生成设备转向通知
- (void)beginGeneratingDeviceOrientationNotifications;
- (void)endGeneratingDeviceOrientationNotifications;
@property(nonatomic,getter=isBatteryMonitoringEnabled) BOOL batteryMonitoringEnabledNS_AVAILABLE_IOS(3_0); // 是否启动电池监控,默认为NO
@property(nonatomic,readonly) UIDeviceBatteryState batteryState NS_AVAILABLE_IOS(3_0); // 如果禁用电池监控,则电池状态为UIDeviceBatteryStateUnknown
@property(nonatomic,readonly) float batteryLevel NS_AVAILABLE_IOS(3_0); //电量百分比, 0 .. 1.0。如果电池状态为UIDeviceBatteryStateUnknown,则百分比为-1.0
@property(nonatomic,getter=isProximityMonitoringEnabled) BOOL proximityMonitoringEnabledNS_AVAILABLE_IOS(3_0); // 是否启动接近监控(例如接电话时脸靠近屏幕),默认为NO
@property(nonatomic,readonly) BOOL proximityState NS_AVAILABLE_IOS(3_0); // 如果设备不具备接近感应器,则总是返回NO
@property(nonatomic,readonly,getter=isMultitaskingSupported) BOOL multitaskingSupportedNS_AVAILABLE_IOS(4_0); // 是否支持多任务
@property(nonatomic,readonly) UIUserInterfaceIdiom userInterfaceIdiom NS_AVAILABLE_IOS(3_2); // 当前用户界面模式
- (void)playInputClick NS_AVAILABLE_IOS(4_2); // 播放一个输入的声音
@end
@protocol UIInputViewAudioFeedback
@optional
@property (nonatomic, readonly) BOOL enableInputClicksWhenVisible; // 实现该方法,返回YES则自定义的视图能够播放输入的声音
@end
UIKIT_EXTERN NSString *const UIDeviceOrientationDidChangeNotification; // 屏幕方向变化通知
UIKIT_EXTERN NSString *const UIDeviceBatteryStateDidChangeNotification NS_AVAILABLE_IOS(3_0); // 电池状态变化通知
UIKIT_EXTERN NSString *const UIDeviceBatteryLevelDidChangeNotification NS_AVAILABLE_IOS(3_0); // 电池电量变化通知
UIKIT_EXTERN NSString *const UIDeviceProximityStateDidChangeNotification NS_AVAILABLE_IOS(3_0); // 接近状态变化通知
UIDevice-b的更多相关文章
- Uiautomator 2.0之UiDevice新增API学习小记
1. InstrumentationRegistry类 1.1. 类说明: 一个暴露的注册实例,持有instrumentation运行的进程和参数,还提供了一种简便的方法调用instrumentati ...
- iOS 整理笔记 获取手机信息(UIDevice、NSBundle、NSLocale)
/* iOS的APP的应用开发的过程中,有时为了bug跟踪或者获取用反馈的需要自动收集用户设备.系统信息.应用信息等等,这些信息方便开发者诊断问题,当然这些信息是用户的非隐私信息,是通过开发ap ...
- iOS - YYAdd对UIDevice的拓展
YYKit中对UIDevice的拓展,accumulate knowledge !!! 首先 #include <sys/socket.h> #include <sys/sysctl ...
- iOS的UIDevice,NSBundle,NSLocale
iOS的APP的应用开发的过程中,有时为了bug跟踪或者获取用反馈的需要自动收集用 户设备.系统信息.应用信息等等,这些信息方便开发者诊断问题,当然这些信息是用户的非隐私信息,是通过开发api可以获取 ...
- IOS设备 UIDevice 获取操作系统 版本 电量 临近手机触发消息检测 (真机亲测可用)
- (void)viewDidLoad { [super viewDidLoad]; // 操作系统 NSString * osName =[[UIDevice currentDevice]syste ...
- 获取iOS系统版本 --- UIDevice
UIDevice类是一个单例,其唯一的实例( [UIDevice currentDevice] ) 代表了当前使用的设备. 通过这个实例,可以获得设备的相关信息(包括系统名称,版本号,设备模式等等). ...
- iOS - UIDevice
前言 NS_CLASS_AVAILABLE_IOS(2_0) @interface UIDevice : NSObject @available(iOS 2.0, *) public class UI ...
- iOS开发 获取手机信息(UIDevice,NSBundle,NSlocale)
在开发中,需要获取当前设备的一些信息,可以通过UIDevice,NSbundle,NSlocale获取. UIDevice UIDevice 提供了多种属性,类函数及状态通知,可以检测手机电量,定位, ...
- UIDevice通知
UIDevice通知 UIDevice类提供了一个单例对象,它代表着设备,通过它可以获得一些设备相关的信息,比如电池电量值(batteryLevel).电池状态(batteryState).设备的类型 ...
- UIDevice 系统信息详解
获取当前设备 //获取当前设备 UIDevice *dev = [UIDevice currentDevice]; 设备和系统基本信息 NSLog(@"设备名称:%@&qu ...
随机推荐
- Python:urllib和urllib2的区别(转)
原文链接:http://www.cnblogs.com/yuxc/ 作为一个Python菜鸟,之前一直懵懂于urllib和urllib2,以为2是1的升级版.今天看到老外写的一篇<Python: ...
- ImageView 缩放
<ImageView android:id="@+id/imageview" android:layout_width="wrap_content" an ...
- Delphi Memo的记事本功能
Delphi Memo的记事本功能 下载地址 : http://download.csdn.net/detail/teststudio/6412883 这个代码实现了Windows ...
- 简单回顾C++中的字符串
C++中有两种字符串形式,一种是C语言字符数组,一般可以使用 char*指针来操作它:另一种是C++中基于标准库的string类型,这算是更高层次的抽象数据类型. 主要讨论一下string类型,既然是 ...
- iOS UIKit:viewController之Segues (4)
@import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/c ...
- 发现并认为这是jQuery1.4.4的一个Bug
说起来还觉得丢人,公司的系统开发了两年,目前jquery的版本还是用的1.4.4. mantis上的Bug一堆,今天在改bug的时候发现一个jQuery的Bug. 改bug嘛,一开始总是各种调试,总感 ...
- python-集合(第二篇(七):集合)
第二篇(七):集合 python 集合 集合标准操作 摘要: 说明: ·类似于数学中学的集合,Python中的集合可以实现去重的功能,通过set()函数来实现: ·sets支持x in set, ...
- enter 默认搜索
onkeydown=" if(event.keyCode==13) Search(); "
- Visual Studio中Js使用智能感知
使用了第三方的JS库或框架,在VS中编写JS代码,发现真是个悲剧,完全只能手打,智能感知没了,这不符合VS的一贯做风只要在写代码的JS文件加上以下代码,就可以有智能感知了 ///<referen ...
- Oracle AWR报告指标全解析-11011552
1-5 Top 5 Timed EventsWaits : 该等待事件发生的次数, 对于DB CPU此项不可用Times : 该等待事件消耗的总计时间,单位为秒, 对于DB CPU 而言是前台进程所消 ...