Navigation drawer menu icon is not displayed correctly

后端 未结 3 446
名媛妹妹
名媛妹妹 2021-02-05 19:35

I want to input my customized icon into the menu in navigation drawer. However, when I run the application it only display a shadow of icon. How do I show the image correctly?

3条回答
  •  爱一瞬间的悲伤
    2021-02-05 20:01

    It works now by removing the tint effect from icon by setItemIconTintList(null). Put the line of code below under the navigationView.

     NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
     navigationView.setItemIconTintList(null);
     navigationView.setNavigationItemSelectedListener(this);
    

提交回复
热议问题