2017-11-11 14 views
-1

enter image description hereナビゲーション引き出しは、私は私のアプリのナビゲーション引き出しを作成

十分な高ではありませんが、上の画像で見ることができるよう、ナビゲーション引き出しが短すぎると、それだけで十分な長さの既存の項目が含まれていることです。

私のコードは次のようになります。背景が暗いので、私はこれが起こったのかわからない

main.xml

<?xml version="1.0" encoding="utf-8"?> 
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context="ykim164cs242.tournamentor.UserMainActivity" 
    android:id="@+id/nav_layout"> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"></LinearLayout> 

    <android.support.design.widget.NavigationView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     app:menu="@menu/navigation_menu" 
     android:layout_gravity="start" 
     app:headerLayout="@layout/navigation_header"> 

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

</android.support.v4.widget.DrawerLayout> 

navigation_menu.xml

<?xml version="1.0" encoding="utf-8"?> 
<menu xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:android="http://schemas.android.com/apk/res/android"> 
    <group> 
     <item android:id="@+id/nav_select_channel" 
      android:title="Select Channel" 
      android:icon="@mipmap/channel_icon"/> 

     <item android:id="@+id/nav_team_list" 
      android:title="Team List" 
      android:icon="@mipmap/team_logo"/> 

     <item android:id="@+id/nav_league_status" 
      android:title="League Status" 
      android:icon="@mipmap/league_status_icon"/> 
    </group> 

</menu> 

が、私は少なくともそれがアプリケーションの全体の高さを埋めるようにしたい。

答えて

0

だけwrap_contentmatch_parentと幅にナビゲーションビューの高さを作るか、またはいくつかの値を与えます。

<android.support.design.widget.NavigationView 
     android:layout_width="wrap_content" 
     android:layout_height="match_parent" 
     app:menu="@menu/navigation_menu" 
     android:layout_gravity="start" 
     app:headerLayout="@layout/navigation_header"> 
関連する問題