有没有一种方法可以检测iPhone是否处于反色模式? [英] Is there a way to detect if the iPhone is in inverse color mode?

查看:92
本文介绍了有没有一种方法可以检测iPhone是否处于反色模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您知道在可访问性方面,用户可以将主页按钮设置为三次单击并设置为反色模式吗?您的应用是否可以检测手机是否处于反色模式?谢谢。

You know how in accessibility, the user can set the home button to triple-click and make that the "inverse color mode"? Is there a way for your app to detect if the phone is in the inverse color mode? Thanks.

推荐答案

是的,而且很简单。您可以调用

Yes, and it's simple. You can call

UIAccessibilityIsInvertColorsEnabled();

会返回 BOOL

您还可以观察到

UIAccessibilityInvertColorsStatusDidChangeNotification

在用户打开或关闭反色时得到通知。

to get notified when the user turns on or off inverted colors.

这篇关于有没有一种方法可以检测iPhone是否处于反色模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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