1
Android 개발을 처음 사용했습니다. 내가 찾은 거의 모든 것을 검색하고 시도했지만 아래 레이아웃을 만들지 못했습니다. Basiciliy는 배경 이미지와 텍스트가 가운데 왼쪽에 정렬 된 행입니다. 나는 모든 행을 정적 높이가되고 배경 이미지가 덮 이도록 (예 : css) 원한다.Android 레이아웃 도움말 - 정적 높이 및 배경 이미지가 적용된 행
Android 개발을 처음 사용했습니다. 내가 찾은 거의 모든 것을 검색하고 시도했지만 아래 레이아웃을 만들지 못했습니다. Basiciliy는 배경 이미지와 텍스트가 가운데 왼쪽에 정렬 된 행입니다. 나는 모든 행을 정적 높이가되고 배경 이미지가 덮 이도록 (예 : css) 원한다.Android 레이아웃 도움말 - 정적 높이 및 배경 이미지가 적용된 행
그것은 매우 분명하지 않다 그러나 각 항목에 대한 고정 높이와 (수직) LinearLayout
RelativeLayout
내부로를 시도 할 수 있습니다. 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>
문서