码迷,mamicode.com
首页 > 移动开发 > 详细

Android之背景图片设置为重复而不是默认的拉伸

时间:2014-10-31 01:10:13      阅读:179      评论:0      收藏:0      [点我收藏+]

标签:android   http   io   ar   sp   文件   div   on   bs   

创建重复的背景图片

在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>

Android之背景图片设置为重复而不是默认的拉伸

标签:android   http   io   ar   sp   文件   div   on   bs   

原文地址:http://www.cnblogs.com/banxian/p/4064041.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!