Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

How to disable "Invert Colors" on specific controls within app

JohnHardmanJohnHardman GBUniversity admin

Having just done some testing of my app on iOS with the accessibility option "Invert colors" enabled, I am pleasantly surprised at how little needs changing within my app to cope with Invert Colors being used..

There are literally two places that need tweaking:
(1) images that I load and display, which are now appearing as negatives
(2) my color specification page, where my red, green and blue sliders are not red, green and blue, and where other named colors are not displayed as those named colors.

Does anybody know:
(a) how to identify whether "Invert colors" is enabled?
(b) how to disable the effect of "Invert colors" on specific controls?

Many thanks,

John H.

Best Answer

  • JohnHardmanJohnHardman GBUniversity admin
    edited October 31 Accepted Answer

    @batmaci said:
    Did you ever find a solution for that? How did you also inverted colors ? Did you do on ios level ? Do you know anyway to achieve it in xamarin forms?

    In the end, I used a custom renderer that set the UIView's AccessibilityIgnoresInvertColors property. That works for "Smart Invert", but not for "Classic Invert", which is what would be expected.

    It would equally be possible to use an Effect rather than a custom renderer, using it to set that same property.

Answers

  • batmacibatmaci DEMember ✭✭✭✭✭
    edited February 2019
    Did you ever find a solution for that? How did you also inverted colors ? Did you do on ios level ? Do you know anyway to achieve it in xamarin forms?
  • JohnHardmanJohnHardman GBUniversity admin

    @batmaci said:
    Did you ever find a solution for that?

    No, but I haven't looked again recently.

    @batmaci said:
    How did you also inverted colors ? Did you do on ios level ?

    From the platform settings.

    @batmaci said:
    Do you know anyway to achieve it in xamarin forms?

    Theming yes (just search for Xamarin Forms Themes). Complete inversion of colors without using custom renderers for Images, no.

  • JohnHardmanJohnHardman GBUniversity admin
    edited October 31 Accepted Answer

    @batmaci said:
    Did you ever find a solution for that? How did you also inverted colors ? Did you do on ios level ? Do you know anyway to achieve it in xamarin forms?

    In the end, I used a custom renderer that set the UIView's AccessibilityIgnoresInvertColors property. That works for "Smart Invert", but not for "Classic Invert", which is what would be expected.

    It would equally be possible to use an Effect rather than a custom renderer, using it to set that same property.

Sign In or Register to comment.