一直遇到这个问题,今天终于找到了解决方法.
在我们的项目中经常遇到横竖屏切换,而又有某个特定的界面必须是特定的显示方式(横屏或竖屏).这就需要如下的处理了.
强制转成横屏:
if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) {
SEL selector =...
分类:
移动开发 时间:
2015-07-22 16:09:48
阅读次数:
149
在Autolayout中 UITextView显示不左上角显示,修改如下在viewDidLoad里面添加如下代码if([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0){self.automaticallyAdjustsScro...
分类:
其他好文 时间:
2015-07-19 11:31:11
阅读次数:
114
iOS 开发 常用到的方法
NSLog(@"uniqueIdentifier: %@", [[UIDevice currentDevice] uniqueIdentifier]);
NSLog(@"name: %@", [[UIDevice currentDevice] name]);
NSLog(@"systemName: %@", [[UIDev...
分类:
移动开发 时间:
2015-07-17 16:24:16
阅读次数:
191
【1】 判断是否是横向屏:BOOL b=UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation);
获取设备uniqueIdentifier :
[UIDevice currentDevice].uniqueIdentifier;但在ios5中,它已被废弃。
http://kensou.blo...
分类:
移动开发 时间:
2015-07-15 13:21:24
阅读次数:
176
BFKit对常用于开发的类进行了扩展,整合了多个常用的控件和开发所需要的功能,是一个通用性的类库。集成后可以帮助更快的App开发。有兴趣的同学可以看看哦。http://code4app.com/ios/BFKit/549d08b4933bf087328bb02e
分类:
其他好文 时间:
2015-07-14 19:59:30
阅读次数:
153
使用-[UIDevice identifierForVendor]或是-[ASIdentifierManager advertisingIdentifier]来作为你框架和应用的唯一标示符。坦白的来说,应对这些变化也不是那么的难,见以下代码片段:NSString *identifierForVend...
分类:
移动开发 时间:
2015-07-08 00:16:37
阅读次数:
195
1,首先123456789//定义宏,判断ios7#define IOS7 [[[UIDevice currentDevice]systemVersion] floatValue] >= 7.0//添加代码if(IOS7){self.edgesForExtendedLayout = UIRectEd...
分类:
移动开发 时间:
2015-07-06 09:57:56
阅读次数:
139
iOS的APP的应用开发的过程中,有时为了bug跟踪或者获取用反馈的需要自动收集用 户设备、系统信息、应用信息等等,这些信息方便开发者诊断问题,当然这些信息是用户的非隐私信息,是通过开发api可以获取到的。那么通过那些api可以 获取这些信息呢,iOS的SDK中提供了UIDevice,NSBundl...
分类:
移动开发 时间:
2015-07-04 16:42:13
阅读次数:
135
UIDevice *device_=[[UIDevice alloc] init]; NSLog(@"设备所有者的名称--%@",device_.name); NSLog(@"设备的类别-----%@",device_.model); NSLog(@"设备的的本地化版本-%@...
分类:
移动开发 时间:
2015-07-04 12:33:41
阅读次数:
128
如下代码是实现调用5S以上设备指纹识别的代码,按照官网给出的代码,会出现识别成功后很久才执行成功后调用的代码,逛了很久的,才知道要将其放入主线程实现才可以。具体代码如下。
1、引入类 import LocalAuthentication
//调用指纹识别函数
func loginWithTouchID()
{
if((UIDevice.currentDevic...
分类:
编程语言 时间:
2015-07-03 12:28:53
阅读次数:
159