2016-12-23 1 views
0

두 개의 버튼이 있습니다. 아래에있는 버튼에 더 높은 버튼이 필요합니다.상대 레이아웃 : 아래 요소로 정렬, 발견되지 않은 ID

<Button 
    android:text="@string/menu_start" 
    android:layout_centerHorizontal="true" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_marginTop="70dp" 
    android:layout_alignLeft="@id/btn_menu_scores" 
    android:layout_alignRight="@id/btn_menu_scores" 
    android:textSize="30dp" 
    android:textStyle="bold" 
    android:layout_marginBottom="20dp" 
    android:id="@+id/btn_menu_start" 
    /> 
<Button 
    android:text="@string/menu_scores" 
    android:layout_gravity="center_horizontal" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:textStyle="bold" 
    android:textSize="30dp" 
    android:layout_marginBottom="20dp" 
    android:id="@+id/btn_menu_scores"/> 

오류 : (20, 35) 어떤 자원 ('ID/btn_menu_scores @'값 'layout_alignLeft'에서) 즉, 주어진 이름과 일치하는 결과가 없습니다.

이 코드는 작동하지 않습니다. 어떻게 수정합니까?

+1

변경 순서. menu_scores를 먼저 선언하십시오. – BR89

답변

2

사용 @+id/btn_menu_scores 대신보기의 ID와 @id/btn_menu_scores :

android:layout_alignLeft="@+id/btn_menu_scores"