2015-09-04 67 views
0

我有查看應該顯示中間的贏家,我想添加底部之字形邊框,迄今爲止很好。只有當我添加圖像並使其合適時纔有問題,它只能重複直到視圖中間(TableRow)。任何想法如何使它做到全屏?Android中重複圖像的問題

這裏是winner.xml

<RelativeLayout 
    android:id="@+id/winner" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="@color/red_transparent" 
    android:visibility="invisible" > 

    <TableLayout 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:gravity="center" 
     android:stretchColumns="field" 
     android:weightSum="9" > 

     <TableRow 
      android:layout_width="0dp" 
      android:layout_height="wrap_content" 
      android:layout_weight="3" 
      android:gravity="bottom" > 

      <ImageView 
       android:layout_width="fill_parent" 
       android:layout_height="12dp" 
       android:adjustViewBounds="true" 
       android:gravity="bottom" 
       android:scaleType="fitXY" 
       android:src="@drawable/zigzag_bottom" /> 
     </TableRow> 

     <TableRow 
      android:layout_width="0dp" 
      android:layout_height="wrap_content" 
      android:layout_weight="2" 
      android:background="#ffffff" 
      android:gravity="center_horizontal|center_vertical" > 

      <RelativeLayout 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:background="@drawable/back" 
       android:gravity="center_horizontal|center_vertical" > 

       <ImageView 
        android:id="@+id/winner_logo" 
        android:layout_width="50sp" 
        android:layout_height="50sp" 
        android:layout_centerHorizontal="true" 
        android:background="@drawable/back" 
        android:contentDescription="@string/app_name" 
        android:src="@drawable/vertical" /> 

       <TextView 
        android:id="@+id/winner_info" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_below="@+id/winner_logo" 
        android:layout_centerHorizontal="true" 
        android:background="@drawable/back" 
        android:contentDescription="@string/app_name" 
        android:src="@drawable/horizon" 
        android:text="@string/winner" 
        android:textColor="#880000" 
        android:textSize="64sp" /> 
      </RelativeLayout> 
     </TableRow> 

     <TableRow 
      android:layout_width="0dp" 
      android:layout_height="fill_parent" 
      android:layout_weight="4" > 

      <ImageView 
       android:layout_width="fill_parent" 
       android:layout_height="12dp" 
       android:adjustViewBounds="true" 
       android:background="@drawable/back" 
       android:gravity="top" 
       android:scaleType="fitXY" 
       android:src="@drawable/zigzag_bottom" /> 
     </TableRow> 
    </TableLayout> 
    </RelativeLayout> 

這裏是重複的圖像

<?xml version="1.0" encoding="utf-8"?> 
<bitmap xmlns:android="http://schemas.android.com/apk/res/android" 
    android:antialias="true" 
    android:src="@drawable/zigzagdown" 
    android:tileMode="repeat" /> 

回答

0

我發現問題

機器人:stretchColumns = 「場」

應android:stretchColumns =「*」,所以它會拉伸所有列