drawable的<bitmap/>标签实现图片复用repeatMode效果
来源:互联网 发布:ubuntu官网下载 编辑:程序博客网 时间:2024/05/29 17:58
实现图片重复效果
1、原图
效果图:
2、实现:
1)原图:crop__tile.png
2)定义drawable:crop__texture.xml
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/crop__tile"
android:tileMode="repeat" />
3)使用,注意是background
<ImageView
android:id="@+id/crop_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/crop__texture"
/>
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/crop__tile"
android:tileMode="repeat" />
3)使用,注意是background
<ImageView
android:id="@+id/crop_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/crop__texture"
/>
阅读全文
0 0
- drawable的<bitmap/>标签实现图片复用repeatMode效果
- 利用Bitmap实现图片放大效果(项目中的drawable路径图片,内存卡中的图片)
- Drawable转BitMap实现Drawable的缩放
- 自定义Drawable实现图片的圆角效果
- Android 将drawable下的图片转换成bitmap、Drawable
- Bitmap和Drawable的相互转换,图片缩放,倒圆角,倒影等的实现
- Bitmap与Drawable、byte[]、图片资源、图片文件的转换
- Drawable之图片转换drawable、bitmap、byte[]
- 自定义 Drawable,实现图片滚动遮蔽效果。图片采用 5.0 版本支持的 SVG
- Drawable 给你的图片加上波纹效果
- Android图片压缩Bitmap,Drawable
- 从drawable下面的图片 创建一个Bitmap
- Android图片二进制与Bitmap、Drawable之间的转换
- Android图片二进制与Bitmap、Drawable之间的转换
- Android图片二进制与Bitmap、Drawable之间的转换
- Android图片二进制与Bitmap、Drawable之间的转换
- 获取系统图片资源 drawable和bitmap之间的转换
- int类型的图片转换成drawable,Bitmap 类型
- 机器学习十大经典算法
- java 无法关联xxxx.xml 的头文件的问题
- Git 常用操作(四) branch
- leetcode第一题twoSum
- C语言位域精解
- drawable的<bitmap/>标签实现图片复用repeatMode效果
- MySQL所使用的数据类型和范围
- 解决 eclipse 使用 SVN 更新多层文件结构提示 path.. is not a working copy
- C++宏及条件编译
- 2017年云栖大会———看阿里的社会责任与家国情怀
- Tarjan缩点+SPFA——缩点
- 根据已知二叉树的遍历顺序,求另一种遍历顺序
- Eclipse插件:mybatis generator的使用步骤
- 冒泡排序