locked
How to get the "Accent" color on iOS and Android platform RRS feed

  • Question

  • User2223 posted

    Hello, Is it a simple way to get the current "Accent" color used by the device? For example, in android it's a blue, in iOS also blue.

    In order to make my application looks like native apllication, how can I get the exact color?

    I tried "Color.Accent" in Xamarin Forms, but it doesn't return the color I used by the device to display selected items or menu items.

    Thank you in advance

    Monday, November 21, 2016 5:15 PM

Answers

  • User2223 posted

    Hello, Since latest version of Xamarin.Forms, there is an "Accent" property in colors enumerators, so my question is not necessary anymore.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Sunday, July 15, 2018 12:40 PM

All replies

  • User37696 posted

    @Jean-DanielGasser,

    I didn't know the answer to this. Out of curiosity I did find this. You would have to do something natively to get this information. Perhaps using the DepedencyService if you want to get it from the shared code.

    Tuesday, November 22, 2016 8:47 PM
  • User2223 posted

    Hello, Since latest version of Xamarin.Forms, there is an "Accent" property in colors enumerators, so my question is not necessary anymore.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Sunday, July 15, 2018 12:40 PM