2016-07-28 3 views

답변

1

그것은 매우 분명하지 않다 그러나 각 항목에 대한 고정 높이와 (수직) LinearLayoutRelativeLayout 내부로를 시도 할 수 있습니다. RelativeLayout AA에서 center에서 규모 유형 항목의 배경 match_parent와 ImageView 및 패딩 텍스트에 대한 TextView : https://developer.android.com/reference/android/widget/ImageView.ScaleType.html

: 안드로이드 규모의 유형에 대한

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

    <RelativeLayout 
     android:layout_width="wrap_content" 
     android:layout_height="100dp"> 
     <ImageView 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:src="@drawable/btn_alert_1" 
      android:scaleType="center"/> 
     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="blabla" 
      android:textColor="@android:color/holo_green_dark" 
      android:paddingLeft="50dp" 
      android:paddingTop="40dp"/> 
    </RelativeLayout> 

    <RelativeLayout 
     android:layout_width="wrap_content" 
     android:layout_height="100dp"> 
     <ImageView 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:src="@drawable/btn_alert_2" 
      android:scaleType="center"/> 
     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="blabla" 
      android:textColor="@android:color/holo_green_dark" 
      android:paddingLeft="50dp" 
      android:paddingTop="40dp"/> 
    </RelativeLayout> 

    <RelativeLayout 
     android:layout_width="wrap_content" 
     android:layout_height="100dp"> 
     <ImageView 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:src="@drawable/btn_alert_1" 
      android:scaleType="center"/> 
     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="blabla" 
      android:textColor="@android:color/holo_green_dark" 
      android:paddingLeft="50dp" 
      android:paddingTop="40dp"/> 
    </RelativeLayout> 
</LinearLayout> 

문서

관련 문제