-1

This is my xml:

<?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"/>

I have at the beginning and the end an Image that I need to be tiled. I set on it a drawable which I created:

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

As you can see, it has tileMode on Repeat. Also the imageViews, both are matching the parrent in width. This is what I get back: As you can see, it does not tile

rosu alin
  • 5,674
  • 11
  • 69
  • 150

1 Answers1

1

Set the bitmap as a background to your container (or on the View you want) instead of adding it as a src to an ImageView

AndreiBogdan
  • 10,858
  • 13
  • 58
  • 106