创建重复的背景图片
在drawable目录下创建一个repeat_bg.xml: src是引用图片的名称
1 |
<? xml version = "1.0" encoding = "utf-8" ?> |
2 |
< bitmap xmlns:android = "http://schemas.android.com/apk/res/android" |
3 |
android:src = "@drawable/bg" |
4 |
android:tileMode = "repeat" /> |
然后在布局的xml文件中可以这样引用:
1 |
< LinearLayout android:layout_width = "fill_parent" |
2 |
android:layout_height = "fill_parent" |
3 |
android:background = "@drawable/repeat_bg" > |
4 |
</ LinearLayout > |
时间: 2024-10-13 00:58:18