The colored image turned to have no color and just a grey vector in drawable?

Viewed 35252

I have created a new Image Assets in the Drawable cus I need to insert a new image in my app, but every time I create a new image asset, the output turns to be no colour at all. I've attached the pic of it.enter image description here

It's confusing and whenever I import it in my layout, it's just grey all over as you can see in the image. Why is it cus I can't find any ready solutions? Let me know if I'm overlooked.

4 Answers

I Found the proper solution! You just have to add this code where you created your NavigationView object!

    NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
    //add the line below and your icon will display as your .svg file
    navigationView.setItemIconTintList(null);
    navigationView.setNavigationItemSelectedListener(this);
Related