2011-05-15 5 views
0

두 이미지 위에 하나의 텍스트를 배치하고 싶습니다. 아래 레이아웃을 사용하고 있지만 텍스트가 맨 위에 오지는 않습니다.두 이미지 위의 텍스트

어떤 도움의 PLS -

<?xml version="1.0" encoding="utf-8"?> 
<ScrollView android:id="@+id/ScrollView01" 
android:layout_width="fill_parent" android:layout_height="fill_parent" 
xmlns:android="http://schemas.android.com/apk/res/android"> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" android:layout_width="fill_parent" 
    android:layout_height="fill_parent" android:background="@drawable/layout" 
    android:gravity="center"> 

    <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     android:orientation="vertical" android:layout_width="fill_parent" 
     android:layout_height="wrap_content" android:gravity="top"> 

     <TableRow android:weightSum="100"> 
      <TextView android:id="@+id/imageText" android:layout_width="wrap_content" 
       android:layout_height="wrap_content" android:gravity="top" 
       android:textStyle="bold" android:typeface="sans" android:text="TWO" 
       android:layout_weight="100"></TextView> 
     </TableRow> 
    </TableLayout> 

    <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     android:orientation="vertical" android:layout_width="fill_parent" 
     android:layout_height="fill_parent"> 

     <TableRow android:weightSum="100"> 
      <ImageView android:id="@+id/image1" android:layout_width="wrap_content" 
       android:layout_height="wrap_content" android:src="@drawable/girrafe" 
       android:visibility="visible" android:gravity="center" 
       android:layout_weight="50" /> 
      <ImageView android:id="@+id/image1" android:layout_width="wrap_content" 
       android:layout_height="wrap_content" android:src="@drawable/girrafe" 
       android:layout_weight="50" /> 
     </TableRow> 
    </TableLayout> 

</LinearLayout> 
</ScrollView> 

답변

1

당신이 뭔가를 원하십니까?

enter image description here

사용이

<?xml version="1.0" encoding="utf-8"?> 
<ScrollView android:id="@+id/ScrollView01" 
android:layout_width="fill_parent" android:layout_height="fill_parent" 
xmlns:android="http://schemas.android.com/apk/res/android"> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:gravity="center"> 
    <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:id="@+id/table"> 
     <TableRow 
      android:layout_height="wrap_content" 
      android:layout_gravity="center_vertical" 
      android:layout_width="wrap_content" 
      android:weightSum="100"> 
      <TextView android:id="@+id/imageText" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:gravity="center" 
       android:textStyle="bold" 
       android:typeface="sans" android:text="TWO" 
       android:layout_weight="100"></TextView> 
     </TableRow> 
     <TableRow android:weightSum="100"> 
      <ImageView android:id="@+id/image1" android:layout_width="wrap_content" 
       android:layout_height="wrap_content" android:src="@drawable/icon" 
       android:visibility="visible" android:gravity="center" 
       android:layout_weight="50" /> 
      <ImageView android:id="@+id/image1" android:layout_width="wrap_content" 
       android:layout_height="wrap_content" android:src="@drawable/icon" 
       android:layout_weight="50" /> 
     </TableRow> 
    </TableLayout> 
</LinearLayout> 
</ScrollView> 
+1

umm..i 중간에 텍스트와 두 가지를 갖고 싶어 u – nasaa

+0

으로 표시된 이미지 내가 편집했습니다. – George

0

이 시도 ... 의 간단한 ...

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" android:orientation="vertical" android:gravity="center_horizontal"> 
    <TextView android:text="TextView" android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> 
    <LinearLayout android:layout_width="match_parent" android:id="@+id/linearLayout1" android:layout_height="wrap_content"> 
     <ImageView android:layout_width="wrap_content" android:id="@+id/imageView1" android:src="@drawable/icon" android:layout_height="wrap_content" android:layout_weight="1"></ImageView> 
     <ImageView android:layout_width="wrap_content" android:id="@+id/imageView2" android:src="@drawable/icon" android:layout_height="wrap_content" android:layout_weight="1"></ImageView> 
    </LinearLayout> 
</LinearLayout>