`
wanggp
  • 浏览: 149705 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

How does one get UI_USER_INTERFACE_IDIOM() to work with iPhone OS SDK < 3.2

阅读更多

 

BOOL iPad = NO;
#ifdef UI_USER_INTERFACE_IDIOM
iPad = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad);
#endif
if (iPad) {
// iPad specific code here
} else {
// iPhone/iPod specific code here
}

 

分享到:
评论

相关推荐

    判断用户设备是iPad还是iPhone的代码

    除了`UI_USER_INTERFACE_IDIOM()`,还有其他方法可以判断设备类型,如检查设备的模型标识符,但这种方法通常不如使用`UI_USER_INTERFACE_IDIOM()`直接和官方推荐。苹果鼓励开发者采用这种更加灵活的方式来适配不同...

    亲测可用成语大全三万条tb_idiom.sql.zip。解释、拼音、出处、典故、难易程度,褒贬色彩,英语日语俄语翻译等

    iom` (`id`, `guid`, `idiom`, `full_pinyin`, `pinyin`, `az`, `description`, `source`, `idiom_traditional`, `spinyin`, `idiom_phonetic`, `idiom_correct_pronunciation`, `idiom_distinguish`, `idiom_...

    猜成语小程序数据库表ims_yf_chengyu_idiom

    【标题】"猜成语小程序数据库表ims_yf_chengyu_idiom"涉及到的是一个与成语相关的微信小程序的数据存储结构。这个数据库表很可能是用来管理小程序内部的成语信息,包括成语的ID、成语内容、含义、出处等关键数据,以...

    QT_namespace_UI的理解

    `pImpl`(Pointer to Implementation)或称为`Impl Pointer`、`Pimpl Idiom`,是一种C++的设计模式,它的主要目标是解耦接口(头文件)和实现(源文件),以减少编译依赖并提高编译效率。在QT的UI中,`pImpl`原则也...

    Google C++ Style Guide(Google C++编程规范)高清PDF

    How can we use a class Foo in a header file without access to its definition? We can declare data members of type Foo* or Foo&. We can declare (but not define) functions with arguments, and/or ...

    cocos2d-x项目快速适配IPAD

    避免直接使用主屏幕的大小,而是根据iPad的用户接口标识符(UI_USER_INTERFACE_IDIOM())来设定视图的大小。这样确保了EAGLView能够根据iPad的实际尺寸进行渲染,而不是按照iPhone的分辨率。 5. **内容缩放因子...

    PyPI 官网下载 | china_idiom-0.0.2-py3-none-any.whl

    资源来自pypi官网。 资源全名:china_idiom-0.0.2-py3-none-any.whl

    pimpl-idiom.rar_pimpl_site:www.pudn.com

    在C++编程中,`Pimpl Idiom`,也称为`Pointer to Implementation`或`Impl Pointer`,是一种设计模式,它用于实现类接口与其实现的分离,以提高代码的编译时间和模块化。这种技术的核心思想是在类的公共接口中只声明...

    iOS Universal Framework.zip

    4. **添加设备检测代码**:在你的源代码中,使用`UI_USER_INTERFACE_IDIOM()`宏或`[[UIDevice currentDevice] userInterfaceIdiom]`来检测当前运行设备,以实现不同设备间的适配。 5. **打包Framework**:完成编码...

    Appian_Enterprise_Installation_and_Administration_Manual.chm

    BPM software and ... The development interface uses a flow-chart idiom, which provides a form of computer-aided software development by generating workflow programs directly from the process diagram.

    Python Cookbook, 2nd Edition

    How to Contact Us Safari® Enabled Acknowledgments Chapter 1. Text Introduction Recipe 1.1. Processing a String One Character at a Time Recipe 1.2. Converting Between Characters and ...

    File_实用案例_实现文件拷贝_FileCopy.java

    System.err.println("Usage: java FileCopy &lt;source&gt; &lt;destination&gt;"); else { // Call copy() to do the copy; display any error messages try { copy(args[0], args[1]); } catch (IOException e) { System....

    New NHibernate + Sample Source Part2

    not only how to get objects into the database, but also how to get them out again * Custom SQL - specify the exact SQL that NHibernate should use to persist your objects. Stored procedures are ...

    New NHibernate + Sample Source Part1

    not only how to get objects into the database, but also how to get them out again * Custom SQL - specify the exact SQL that NHibernate should use to persist your objects. Stored procedures are ...

    NHibernate 2.0.1 + Movies + Sample Source Part2

    not only how to get objects into the database, but also how to get them out again * Custom SQL - specify the exact SQL that NHibernate should use to persist your objects. Stored procedures are ...

    idiom翻译软件

    "idiom翻译软件"是一款专为用户提供了高效翻译服务的应用程序。它被设计用来帮助用户理解和传达不同语言之间的意义,确保跨文化交流的准确性和流畅性。这款软件在经过实际测试后,被认为是非常实用且功能完备的。 ...

    ExceptionalCpp_47EngineeringPuzzlesProgrammingProblemsSol.chm

    Exceptional C++ shows by example how to go about sound software engineering in standard C++. Do you enjoy solving thorny C++ problems and puzzles? Do you relish writing robust and extensible code? ...

    idiom4.sql

    四字成语mysql数据30810条

    English Phrasal Verb Dictionary&English-Idiom-Expression

    useEnglish 资源E nglish Phrasal Verb & Idiom

Global site tag (gtag.js) - Google Analytics