2017-08-20 4 views
0

ここで使用しているアイコンはすべて色付きですが、実行時には表示されません。 私はapp:itemIconTint = "@ null"をxmlにしようとしましたが、使用しませんでした。スライド式引き出しに色付きのアイコンを使用できません

XML CODE: 
<?xml version="1.0" encoding="utf-8"?> 
<menu xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto"> 

    <item android:id="@+id/home" 
     android:title="@string/home" 
     android:icon="@drawable/icon_home" 
     app:itemIconTint="@null"/> 

    <item android:id="@+id/help" 
     android:title="@string/help" 
     android:icon="@drawable/icon_help"/> 
</menu> 

enter image description here

**これは、別のレイアウトファイルであるスライド引き出しが表示されますでした。私はそれは、単純な**

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent > 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 
     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      ........../> 

    </LinearLayout> 

    <android.support.v4.widget.DrawerLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 

     <android.support.design.widget.NavigationView 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      app:menu="@menu/navigation" 
      android:layout_gravity="start"> 

     </android.support.design.widget.NavigationView> 

    </android.support.v4.widget.DrawerLayout> 
</RelativeLayout> 
+0

NavigationView @ Aryanを使用していますか? –

+0

はいナビゲーションビューを使用していますが、XMLコードも追加しています。 –

+0

あなたのアクティビティに追加する@Aryan –

答えて

1

がnavi_viewがあなたのNavigationViewの目的であるあなたの活動

navi_view.setItemIconTintList(null); 

にこれを追加するために不要なコードを削除しました。

関連する問題