2015-09-04 2 views
0

У меня есть представление, которое должно показывать победителя посередине, я хочу добавить нижнюю границу зигзага, пока что так хорошо. Только проблема, когда я добавляю изображение и делаю его fitXY, он повторяется только до середины обзора (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

I Found выпуск

андроида: stretchColumns = "поле"

должен быть android: stretchColumns = "*", поэтому он растянет все столбцы

Смежные вопросы