iOS写入宏检测3.5英寸或4英寸显示屏 [英] iOS Writing Macro detect 3.5 inch or 4 inch display
本文介绍了iOS写入宏检测3.5英寸或4英寸显示屏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试编写一个宏来确定该设备是3.5英寸还是4英寸。下面有类似的事情。
I am trying to write a macro to determine the device is 3.5 inch or 4 inch. Some thing similar below.
#define IOS_OLDER_THAN_6 ( [ [ [ UIDevice currentDevice ] systemVersion ] floatValue ] < 6.0 )
#define IOS_NEWER_OR_EQUAL_TO_6 ( [ [ [ UIDevice currentDevice ] systemVersion ] floatValue ] >= 6.0 )
可以谁来帮帮我。请
推荐答案
您可以使用以下方式检测3.5英寸或4英寸的iphopne: -
you can detect iphopne 3.5 inch or 4 inch using bellow:-
#define isiPhone5 ([[UIScreen mainScreen] bounds].size.height == 568)?TRUE:FALSE
您可以使用以下方法检查它: -
you can check it using bellow method for example:-
if (isiPhone5)
{
// this is iphone 4 inch
}
else
{
//Iphone 3.5 inch
}
请看一下这个链接,因为你知道所有关于宏的确定该设备为3.5英寸或4英寸。
这篇关于iOS写入宏检测3.5英寸或4英寸显示屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文