On iOS 7.0.3 turning on increased contrast mode removes the blur effects you'd normally see in the nav bar if you're using a bar tint color with an alpha less than 1.0, which makes the nav bar seem much more transparent than it is with the default settings.

Is there a way to programmatically check to see if this setting is enabled? While UIAccessibility has a ton of other functions like UIAccessibilityIsInvertColorsEnabled(), I can't find anything related to this setting specifically.

有帮助吗?

解决方案 2

Apparently there's no public API for checking whether that option is on.

According to the UIKit Function Reference, the only checks you can perform are the following

  • UIAccessibilityPostNotification
  • UIAccessibilityIsVoiceOverRunning
  • UIAccessibilityIsClosedCaptioningEnabled
  • UIAccessibilityRequestGuidedAccessSession
  • UIAccessibilityIsGuidedAccessEnabled
  • UIAccessibilityIsInvertColorsEnabled
  • UIAccessibilityIsMonoAudioEnabled
  • UIAccessibilityZoomFocusChanged
  • UIAccessibilityRegisterGestureConflictWithZoom
  • UIAccessibilityConvertFrameToScreenCoordinates
  • UIAccessibilityConvertPathToScreenCoordinates

其他提示

As of iOS 8 there is a way to check:

UIKIT_EXTERN BOOL UIAccessibilityDarkerSystemColorsEnabled() NS_AVAILABLE_IOS(8_0);

as of modern iOS:

UIAccessibility.isDarkerSystemColorsEnabled

For iOS 13 and above we can use accessibilityContrast

Documentation

Use this trait to determine whether the user requested a high contrast between foreground and background content. The user sets the contrast level in the Accessibility area in Settings.

Apple doc link

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top