How to tile small texture image onto page as its background

You don’t need to set a big size image as the background of pages if the image is texture or uniform color.

How to tile small texture image onto big page/area as its background?

First, define drawable xml in res/drawable,

bg_texture_image.xml:

1
2
3
4
<?xml version=”1.0″ encoding=”utf-8″?>
<bitmap xmlns:android=”http://schemas.android.com/apk/res/android”
android:src=”@drawable/bg_image”
android:tileMode=”repeat” />

Second, use it as the background,

1
android:background=”@drawable/bg_texture_image”  
上一篇:MySQL定义和变量赋值


下一篇:Java开发笔记(四十四)本地日期时间与字符串的互相转换