您的位置:首页 > 移动开发 > Android开发

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

2013-03-21 17:31 429 查看
在drawable目录下创建一个bitmap_bg.xml: src是引用图片的名称

<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_launcher"
android:tileMode="repeat" >
</bitmap>


然后在布局的xml文件中可以这样引用:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bitmap_bg">
</RelativeLayout>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: