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” |
本文详细介绍了如何将小尺寸的纹理图片重复铺满到大页面作为背景的方法,通过定义 drawable xml 文件并设置 tileMode 属性来实现。

被折叠的 条评论
为什么被折叠?



