2016-03-31 4 views
-1
funktioniert

Das ist mein xml:Tilling ein Bild mit einem Bitmap-xml nicht

<?xml version="1.0" encoding="utf-8"?> 

<ImageView 
    android:id="@+id/up_margin" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:src="@drawable/ticket_up_tile"/> 

<RelativeLayout 
    android:id="@+id/container" 
    android:layout_below="@id/up_margin" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:background="@color/white" 
    android:layout_margin="10dp"> 

    <TextView 
     android:id="@+id/origin" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:textColor="@color/gray32" 
     android:textSize="17dp"/> 

    <TextView 
     android:id="@+id/destination" 
     android:layout_below="@id/origin" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:translationY="-5dp" 
     android:textColor="@color/gray32" 
     android:textSize="17dp"/> 

    <TextView 
     android:id="@+id/title" 
     android:layout_below="@id/destination" 
     android:layout_marginTop="10dp" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:textColor="@color/gray32" 
     android:textSize="28dp" 
     android:text="@string/intro.mileage"/> 

    <View 
     android:id="@+id/line1" 
     android:layout_marginTop="10dp" 
     android:layout_width="match_parent" 
     android:layout_height="0.5dp" 
     android:layout_below="@id/title" 
     android:background="@color/gray32"/> 

    <RelativeLayout 
     android:layout_marginTop="10dp" 
     android:layout_below="@id/line1" 
     android:id="@+id/prices_container" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 

    </RelativeLayout> 

    <View 
     android:id="@+id/line2" 
     android:layout_marginTop="10dp" 
     android:layout_width="match_parent" 
     android:layout_height="0.5dp" 
     android:layout_below="@id/prices_container" 
     android:background="@color/gray32"/> 

    <TextView 
     android:id="@+id/dismiss" 
     android:layout_below="@id/line2" 
     android:textColor="@color/background" 
     android:padding="10dp" 
     android:layout_centerHorizontal="true" 
     android:text="@string/Dismiss" 
     android:gravity="center_horizontal" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" /> 

</RelativeLayout> 
<ImageView 
    android:id="@+id/down_margin" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_below="@id/container" 
    android:src="@drawable/ticket_down_tile"/> 

ich am Anfang haben und am Ende ein Bild, das ich brauche, gekachelt werden. ich auf sie ein ziehbar gesetzt, die ich erstellt:

<bitmap 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:tileMode="repeat" 
android:src="@drawable/popup_ticket_up"/> 

Wie Sie sehen können, hat es TILEMODE auf Repeat. Auch die imageViews stimmen mit der Breite überein. Dies ist, was ich zurück: As you can see, it does not tile

Antwort

1

die bitmap als background zu Ihrem Container Set (oder auf der View Sie wollen), statt es als src zu einem ImageView

Hinzufügen
Verwandte Themen