0
죄송합니다. 질문을하기 전에 물어 보았지만 안드로이드에서는 초보자입니다. 나는 안드로이드에 작은 응용 프로그램을 구현하고 레이아웃 문제에 갇혀있다. 내가 옆에 4 이미지면을 넣고 난 레이아웃에 그런 이미지를 넣어 어떻게해야안드로이드는 레이아웃의 이미지에 텍스트를 넣습니다.
수있는 사람이 나에게 도움이 그림에서와 같이 각각의 이미지에 흰색 상자의 중간에 텍스트를 넣어 가지고 이처럼 각 이미지의 텍스트. 어떤 제안이라도 대단히 감사합니다 !!!. 몇 가지 코드를 시도했지만 여전히 이미지, 이미지 크기에서 수행해야 할 작업을 확신 할 수 없습니까?, 스케일 문제가 있습니까?, TableLayout을 사용합니까?
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
android:shrinkColumns="*"
android:stretchColumns="*" >
<!-- Row 1 with single column -->
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal" >
<TextView
android:id="@+id/recipe_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_span="4"
android:padding="10dip"
android:paddingBottom="30dip" />
</TableRow>
<!-- Row 2 with 3 columns -->
<TableRow
android:id="@+id/tableRow1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/cal"
android:layout_weight="1"
android:background="@drawable/fat1"
android:gravity="center"
android:padding="20dip"
android:text="text1"
android:textColor="#000000" />
<TextView
android:id="@+id/fat"
android:layout_weight="1"
android:background="@drawable/fat2"
android:gravity="center"
android:padding="20dip"
android:text="text2"
android:textColor="#000000" />
<TextView
android:id="@+id/carbon"
android:layout_weight="1"
android:background="@drawable/fat3"
android:gravity="center"
android:padding="20dip"
android:text="text3"
android:textColor="#000000" />
<TextView
android:id="@+id/protein"
android:layout_weight="1"
android:background="@drawable/fat4"
android:gravity="center"
android:padding="18dip"
android:text="text4"
android:textColor="#000000" />
</TableRow>
</TableLayout>
</ScrollView>
덕분에이 같은 자바 코드에서 뭔가를 폭을 변경해야 할 모든 텍스트 뷰에 대한 폭이 동일 할 경우, 나는 그것이 나를 많이 도울 수 있다고 생각한다. – bnguyen