实现图片重复效果
1、原图
![ss](https://i-blog.csdnimg.cn/blog_migrate/1ce40ca36f1d6dab4f6fc5005bfc84a9.png)
效果图:
![ss](https://i-blog.csdnimg.cn/blog_migrate/9f02b979782e2c1e1f25fa63221da18f.png)
2、实现:
1)原图:crop__tile.png
![ss](https://i-blog.csdnimg.cn/blog_migrate/dd563dd6423609e38ae4cb86312baf26.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"
/>