检测iPad应用程序的iPad 2x按钮 [英] detect iPad 2x button for iPhone app

查看:126
本文介绍了检测iPad应用程序的iPad 2x按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法检测到你的iPhone应用程序我们在iPad上运行2x / 1x?

Is there a way to detect that your iPhone app us running 2x/1x on an iPad?

我需要能够检测到每英寸点数的差异对于我的应用程序。

I need to be able to detect the difference in points per inch for my app.

推荐答案

您可以通过注册通知来检测更改 _UIClassicApplicationWillChangeZoomNotificationName 然后使用或多或少的@magma在他的回答中概述的方法来处理规模变化。 _UIClassicApplicationWillChangeZoomNotificationName 会告诉您何时使用2x/1x按钮更改比例。

You can detect the change by registering for the notification _UIClassicApplicationWillChangeZoomNotificationName and then handle the scale change using more or less the method outlined by @magma in his answer. _UIClassicApplicationWillChangeZoomNotificationName will tell you when the "2x"/"1x" button has been used to change the scale.

这篇关于检测iPad应用程序的iPad 2x按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆