locked
Color tint code (begginer) RRS feed

  • Question

  • User381038 posted

    Hey, I'm new to programming and my final work at school is to create an android game. (Xamarin.Android) In my game, there is a png icon of a player (ImageView). AXML file has an option in properties called TINT (background and Foreground TINT doesn't change anything, since the icon is .png), that changes the color of the player png icon. But i need to do the color change in my Activity.cs based on spinner choice.

    Let's say there are 2 choices in my spinner - blue and black. Default icon color is set to white, but if the user chooses blue, I need to change the png icon tint to blue. In case he chooses black, the color tint will be set to black.

    I'm here to ask you, do you know the code for color tint (imageview.setTint or something like that)? I couldn't find any useful information, or I'm just stupid and missed it...

    Saturday, December 29, 2018 3:18 PM

All replies

  • User371688 posted

    You can check:
    https://stackoverflow.com/questions/38653357/how-to-set-color-for-imageview-in-android/38653714 https://stackoverflow.com/questions/20121938/how-to-set-tint-for-an-image-view-programmatically-in-android

    Hope it can help you. If you encounter any problems, you can create a new case so that we can help you.

    Monday, December 31, 2018 2:32 AM