有时候我们需要将一个图片横向或者纵向的平铺(重复循环),这个时候我们需要创建一个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了!


最新文章

  1. socket编程中服务器端常用函数 以及简单实现
  2. c#基础系列(转)
  3. CCF推荐国际学术期刊
  4. Zabbix agent on Microsoft Windows
  5. MySQL DATE_SUB() 函数
  6. nginx + tomcat集群和动静资源分离
  7. Linux系统内核制作和内核模块的基础
  8. yii2 AR需要注意的地方
  9. Content-Language:en-US
  10. AE分级渲染
  11. Android开发效率的小技巧
  12. 最短路径算法专题3----Bellman-Ford
  13. SQL Server错误严重性级别和异常处理
  14. ASI与AFN网络请求的的比较
  15. Linux中Zabbix4.0的搭建
  16. centos7.4安装redis
  17. 你会跟谁结婚zz
  18. 【转】Python之xml文档及配置文件处理(ElementTree模块、ConfigParser模块)
  19. Algorithm 算法基础知识(未完成
  20. &lt;script&gt;标签里的defer和async属性 区别(待补充)

热门文章

  1. HDU5534--Partial Tree (完全背包)
  2. Corporative Network_并查集
  3. 为什么web标准中无法设置IE浏览器滚动条颜色了?
  4. Team Foundation API - 编程访问 WorkItem
  5. Prepared Java infrastructure for distributed scenarios
  6. 程序员MM的自白:磨人小妖精之安卓碎片化
  7. public static void main(String[] args){}函数诠释
  8. c#部分---一维数组、冒泡排序、foreach的用法
  9. JAVA常用运算符
  10. UVA-11468 Substring(AC自动机+DP)