2016-09-04 3 views
1

내가 DrawerLayout에 메뉴 항목에 대한 사용자 정의 레이아웃을 연결하기 위해 노력하고있어에 대한 사용자 정의 레이아웃의 전체 폭을 설정하지만, 당신이 보는대로 메뉴 항목은 전체 폭이 없어 내가이 문제안드로이드는 메뉴

를 해결할 수없는 enter image description here

내 메뉴 레이아웃

<?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"> 
    <group android:id="@+id/groupOne"> 
     <item 
      android:id="@+id/inbox" 
      app:actionLayout="@layout/create_new"/> 
    </group> 
</menu> 

create_new

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
       android:orientation="horizontal" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:gravity="center_vertical" 
       android:paddingTop="5dp" 
       android:paddingBottom="5dp"> 

    <TextView 
     android:layout_width="match_parent" 
     android:layout_height="25dp" 
     android:text="New Text" 
     android:gravity="left|center" 
     android:layout_marginLeft="20dp" 
     android:background="#000" 
     android:textColor="#fff"/> 
</LinearLayout> 
,691로 그 내 사용자 지정 레이아웃
+0

행운이 있나요? –

답변

0

그래, 나를 위해 일한 유일한 방법은 사용자 정의 레이아웃의 루트보기에서 android:layout_width="100000dp"으로 설정하는 것이 었습니다.

추악한 해킹 그러나.