码迷,mamicode.com
首页 >  
搜索关键字:currentdevice    ( 174个结果
iOS 在不添加库的情况下 通过抽象类来获取自己想要的方法
#define SYSTEM_VERSION_MORE_THAN_BFDATA(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)+ (NS....
分类:移动开发   时间:2015-08-10 17:46:35    阅读次数:127
app基本信息
1.获取设备信息 NSLog(@"设备名称:%@",[[UIDevice currentDevice] systemName]); NSLog(@"版本号:%@",[[UIDevice currentDevice] systemVersion]); NSLog(@"设备名:%@",...
分类:移动开发   时间:2015-08-09 20:24:07    阅读次数:143
iOS 8设置CLLocation授权
1. 调用CLLocation前, 添加以下代码: // 获取授权 if ([UIDevice currentDevice].systemVersion.doubleValue >= 8.0) { // 始终允许访问位置信息 // [_manager r...
分类:移动开发   时间:2015-08-05 00:48:07    阅读次数:134
IOS开发教程--Xcode6,CLLocationManager无法定位解决方案
iOS8 之后要自己写定位授权,否则就没有定位权限。 调用代码: if ([[[UIDevice currentDevice] systemVersion] doubleValue] > 8.0)            {               //设置定位权限 仅ios8有意义               [locationManager requestWhenInUseA...
分类:移动开发   时间:2015-08-04 19:25:43    阅读次数:143
打开系统设置页
- (void) action_openSettings:(id)sender{ if ([[UIDevice currentDevice]systemVersion].floatValue >= 8.0) { // 如果app没有Settings.bundle,则打开系统设置页...
分类:其他好文   时间:2015-08-01 15:41:30    阅读次数:99
7、8上的是否是今年
/** 是否为今年 */- (BOOL)isThisYear{ if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) { NSCalendar *calendar = [NSCalendar curre...
分类:其他好文   时间:2015-07-31 12:24:56    阅读次数:102
(九十一)距离传感器的使用
iPhone上的距离传感器通过UIDevice开启,开启后系统以Notification的方式通知。 ①开启距离传感器,监听通知: - (void)viewDidLoad { [super viewDidLoad]; // 开启传感器在iOS3之后通过UIDevice的currentDevice的proximityMonitoringEnabled设置 [UIDevi...
分类:其他好文   时间:2015-07-27 23:01:59    阅读次数:157
常用小代码(动态更新)
1,自定义颜色#define cctvColor(r,g,b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]2,系统版本号#define IOS7 [[UIDevice currentDevice]...
分类:其他好文   时间:2015-07-24 06:56:06    阅读次数:147
小胖说事30------iOS 强制转成横屏的方式
一直遇到这个问题,今天终于找到了解决方法. 在我们的项目中经常遇到横竖屏切换,而又有某个特定的界面必须是特定的显示方式(横屏或竖屏).这就需要如下的处理了. 强制转成横屏: if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) { SEL selector =...
分类:移动开发   时间:2015-07-22 16:09:48    阅读次数:149
UITextView 不左上角显示
在Autolayout中 UITextView显示不左上角显示,修改如下在viewDidLoad里面添加如下代码if([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0){self.automaticallyAdjustsScro...
分类:其他好文   时间:2015-07-19 11:31:11    阅读次数:114
174条   上一页 1 ... 7 8 9 10 11 ... 18 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!