Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Bitmap Tile on X Only

Tags:

android

bitmap

I want to use a Bitmap that Tile on the Horizontal only, is there any way to do it, so that it will expand only on X like repeat x on CSS. I using the following code but the bitmap tile Horizontal and vertical :

<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
    android:src="@drawable/pinstripe" 
    android:tileMode="repeat"
    android:gravity ="top|fill_horizontal"
    android:dither="true"/>
like image 586
imrabti Avatar asked Sep 07 '10 10:09

imrabti


1 Answers

Here is the solution. You can create BitmapDrawable in code and specify only X tile mode Android Tile Bitmap

like image 71
Fedor Avatar answered Oct 03 '22 14:10

Fedor