2013-07-16 4 views
0

그래서 안드로이드 앱의 로그인 및 등록 페이지에서 작업 중입니다.이 레이아웃을 구현하려고하는데 제대로 작동하지 않습니다.안드로이드 레이아웃 문제

원하는 레이아웃을 찾으십시오.

desired layout

배경 이미지는 화면 전체를 커버하고 우측 상단 버튼 및 중앙 하단 버튼이있다.

그러나 이것은 내가 디자인

current layout

을 구현에서 가져온이 내가 당신을 넣을 수 있도록

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" android:fitsSystemWindows="true" android:alwaysDrawnWithCache="false" 
    android:layout_gravity="center"> 

    <ImageView 
     android:id="@+id/imageView1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentLeft="true" 
     android:scaleType="center" 
     android:layout_alignParentTop="true" android:src="@drawable/nyork2"/> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:gravity="top" > 

     <Button 
     android:id="@+id/register" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:gravity="left" 
     android:text="@string/button_register" 

     /> 
    <Button 
     android:id="@+id/login" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:gravity="left" 
     android:text="@string/button_login" 

     /> 
    </LinearLayout> 





</RelativeLayout> 

답변

2

도움이됩니다

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" android:fitsSystemWindows="true" android:alwaysDrawnWithCache="false" 
    android:layout_gravity="center"> 

    <ImageView 
     android:id="@+id/imageView1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentLeft="true" 
     android:scaleType="center" 
     android:layout_alignParentTop="true" android:src="@drawable/nyork2"/> 
    <Button 
      android:id="@+id/register" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentTop="true" 
      android:layout_alignParentRight="true" 
      android:text="@string/button_register" /> 

    <Button 
      android:id="@+id/login" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentBottom="true" 
      android:layout_centerHorizontal="true" 
      android:text="@string/button_login"/> 

</RelativeLayout> 
+0

감사합니다. 그것이 옳은 대답입니다. 또한 나는 단지 당신이 실제로 주위에 구성 요소를 드래그 할 수있는 일식과 깨달았다. –

+0

문제가 없습니다! 좋은 일을 계속하십시오! –

0

선형 레이아웃을 제거 레이아웃 파일에서 적어 둔 것입니다 것입니다 원하는 위치에있는 버튼

관련 문제