码迷,mamicode.com
首页 >  
搜索关键字:uidevice    ( 271个结果
需要获取设备方向变化(UIDeviceOrientation)的消息
如果需要获得UIDeviceOrientation的转换消息的话,只需要: [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; [[NSNotificationCenter defaultCenter] ...
分类:其他好文   时间:2015-10-07 11:59:24    阅读次数:175
iOS applicationIconBadgeNumber(后台app红色角标)
float?version?=?[[[UIDevice?currentDevice]?systemVersion]?floatValue]; if?(version?>=?8.0)?{ ????UIUserNotificationSettings?*settings?=?[UIUserNotificationSettings?settingsForTy...
分类:移动开发   时间:2015-09-30 16:37:19    阅读次数:252
Swift - 判断设备方向(或监听设备方向的改变)
通过UIDevice.currentDevice()来获取设备,可以取得设备当前的方向。同时,我们可以添加一个通知来监听设备方向的变化,这样在开发中可以对不同的方向定制不同的排版布局界面。下面通过一个样例,演示如何监测设备方向:123456789101112131415161718192021222...
分类:编程语言   时间:2015-09-28 11:41:03    阅读次数:191
强制横竖屏间切换
if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) { SEL selector = NSSelectorFromString(@"setOrientation:"); ...
分类:其他好文   时间:2015-09-17 23:26:27    阅读次数:478
ios 指南针
指南针图片 IBOutlet UIImageView *compassView 1 #import "ViewController.h" 2 #import 3 4 #define isIOS(version) ([[UIDevice currentDevice].systemVersion f.....
分类:移动开发   时间:2015-09-15 17:58:04    阅读次数:1026
iOS 地图(MKMapView)
//定位 需要在info中添加NSLocationWhenInUseUsageDescription if ([[UIDevice currentDevice].systemVersion doubleValue]>=8.0) { //获取权限 [self.locat...
分类:移动开发   时间:2015-09-15 16:27:42    阅读次数:209
根据光线感应关闭和开启屏幕
根据光线感应关闭和开启屏幕UIDevice *_curDevice = [UIDevice currentDevice]; [_curDevice setProximityMonitoringEnabled:YES]; NSNotificationCenter *_defaultCenter =.....
分类:其他好文   时间:2015-09-10 19:31:22    阅读次数:139
iOS检测系统版本的宏
#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)#define SYSTEM_VERSI...
分类:移动开发   时间:2015-09-08 18:21:28    阅读次数:239
传感器+加速计+摇一摇
概述sensoriPhone自带很多传感器,常见的如下表所示:系统针对各种sensor都有相应的使用方法,eg: 距离传感器使用// 开启距离感应功能[UIDevice currentDevice].proximityMonitoringEnabled = YES;// 监听距离感应的通知[[NSN...
分类:其他好文   时间:2015-09-04 12:24:17    阅读次数:220
iOS开发之UIDevice通知
UIDevice类提供了一个单例对象,它代表着设备,通过它可以获得一些设备相关的信息,比如电池电量值(batteryLevel)、电池状态(batteryState)、设备的类型(model,比如iPod、iPhone等)、设备的系统(systemVersion)UIDevice特点:(1)通过[U...
分类:移动开发   时间:2015-08-31 21:27:29    阅读次数:154
271条   上一页 1 ... 9 10 11 12 13 ... 28 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!