android设置重复背景
16lz
2021-01-24
android设置重复背景
创建重复的背景图片
在drawable目录下创建一个repeat_bg.xml:src是引用图片的名称
1 2 3 4 5 6 7 8 | 1 <?xmlversion= "1.0" encoding= "utf-8" ?> 2 <bitmapxmlns:android= "http://schemas.android.com/apk/res/android" 3 android:src= "@drawable/bg" 4 android:tileMode= "repeat" /> |
然后在布局的xml文件中可以这样引用:
1 2 3 4 5 6 7 8 | 1 <LinearLayoutandroid:layout_width= "fill_parent" 2 android:layout_height= "fill_parent" 3 android:background= "@drawable/repeat_bg" > 4 </LinearLayout> |
更多相关文章
- android progressbar 藏到imageview下面
- Android(安卓)GridView中GridAdapter 用法详解
- Android(安卓)ButterKnife Zelezny
- android ListView增加Animation效果
- Android学习笔记:RecyclerView
- Android的Layout --- 布局
- Android(安卓)PullZoomView:PullToZoomScrollViewEx(2)
- Android开发常见错误及技巧
- Android实现界面跳转功能