2014-12-13 7 views

답변

0

당신은 단순히 RelativeLayout의를 사용하고 다른 사람에 따라 모든 요소를 ​​배치 할 수 있습니다 : 배경 + 텍스트로

이미지는 수평 및 수직 + 버튼을 중심으로.

뭔가 같은 :

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" android:layout_height="match_parent"> 

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

    <TextView 
     android:id="@+id/centered_text" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_centerInParent="true" /> 

    <LinearLayout 
     android:id="@+id/bottom_right_container" 
     android:layout_alignParentRight="true" 
     android:layout_alignParentBottom="true" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content"> 

     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" /> 

     <!-- the stuff bottom right --> 

    </LinearLayout> 

</RelativeLayout> 
+0

감사합니다,하지만 어떻게 이미지 뷰의 중간에 @ + ID/centered_text를 만드는 방법? –

+0

알았습니다! 다른 상대적 레이아웃에서 imageview와 textview를 추가하고 고정 된 높이를주었습니다. –

+0

@OssamaBenallouch 고정 된 높이를 피해야합니다. TextView에 사용되는 centerInParent와 같은 ImageView 및 RelativeLayout 매개 변수의 scaleTypes를 살펴보십시오. 이들의 조합은 더 나은 스케일링을 허용해야합니다. – zgc7009

관련 문제