Android 背景图片重复平铺
2024-10-18 23:25:28
有时候我们需要将一个图片横向或者纵向的平铺(重复循环),这个时候我们需要创建一个xml文件,如下:
<?xml version ="1.0" encoding ="utf-8" ?>
<!-- 背景图片平铺 -->
<bitmap xmlns:android ="http://schemas.android.com/apk/res/android"
android:src ="@drawable/subtitlebg"
android:tileMode="repeat" />
android:src:设置需要重复平铺的图片
android:tileMode:设置图片的平铺方式,有四种方式:
然后在xml布局文件中引用该文件:
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/subtitlebg_bitmap"
/>
然后运行程序就ok了!
最新文章
- socket编程中服务器端常用函数 以及简单实现
- c#基础系列(转)
- CCF推荐国际学术期刊
- Zabbix agent on Microsoft Windows
- MySQL DATE_SUB() 函数
- nginx + tomcat集群和动静资源分离
- Linux系统内核制作和内核模块的基础
- yii2 AR需要注意的地方
- Content-Language:en-US
- AE分级渲染
- Android开发效率的小技巧
- 最短路径算法专题3----Bellman-Ford
- SQL Server错误严重性级别和异常处理
- ASI与AFN网络请求的的比较
- Linux中Zabbix4.0的搭建
- centos7.4安装redis
- 你会跟谁结婚zz
- 【转】Python之xml文档及配置文件处理(ElementTree模块、ConfigParser模块)
- Algorithm 算法基础知识(未完成
- <;script>;标签里的defer和async属性 区别(待补充)
热门文章
- HDU5534--Partial Tree (完全背包)
- Corporative Network_并查集
- 为什么web标准中无法设置IE浏览器滚动条颜色了?
- Team Foundation API - 编程访问 WorkItem
- Prepared Java infrastructure for distributed scenarios
- 程序员MM的自白:磨人小妖精之安卓碎片化
- public static void main(String[] args){}函数诠释
- c#部分---一维数组、冒泡排序、foreach的用法
- JAVA常用运算符
- UVA-11468 Substring(AC自动机+DP)