2013-06-13 3 views
0

앱의 간단한 메뉴를 만들고 싶습니다. 여기에 (경로를 구축 수정 XML에서 편집) XML 코드Android Studio에서 메뉴를 만드는 동안 렌더링 문제가 발생했습니다.

<?xml version="1.0" encoding="utf-8"?> 
<menu xmlns:android="http://schemas.android.com/apk/res/android" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content"> 
    <item android:id="@+id/new_game" 
      android:icon="@drawable/magnify" 
      android:title="New Game" 
      android:showAsAction="ifRoom" 
      android:layout_height="wrap_content"/> 
    <item android:id="@+id/help" 
      android:icon="@drawable/magnify" 
      android:title="Help" /> 
</menu> 

입니다하지만 디자인 탭을 클릭하면, 그것은 "렌더링 문제 다음 클래스는 -item를 찾을 수 없다는 오류를 제공합니다 -menu (빌드 경로 수정, XML로 편집) "

어떻게해야합니까? 그것은 당신이 사용할 수없는 메뉴에서 일부 속성이 보이는 사전

답변

0

에서

감사합니다 - 그들은 레이아웃 속성이있어,없는 메뉴 속성.

이 시도 :

<?xml version="1.0" encoding="utf-8"?> 
<menu xmlns:android="http://schemas.android.com/apk/res/android"> 
    <item android:id="@+id/new_game" 
      android:icon="@drawable/magnify" 
      android:title="New Game" 
      android:showAsAction="ifRoom" 
    /> 
    <item android:id="@+id/help" 
      android:icon="@drawable/magnify" 
      android:title="Help" 
      android:showAsAction="ifRoom" 
    /> 
</menu> 
+0

그것은 "layout_height"와 "layout_width는" – user1874658

+0

오류 메시지를 게시 해주십시오 정의되어야 없다는 오류를 제공합니다. – GreyBeardedGeek

관련 문제