1、在xml檔案中實作
在res下建立drawable目錄,在drawable目錄中建立xml檔案:repeat_bg.xml
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:Android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_launcher"
android:tileMode="repeat"
android:dither="true">
</bitmap>
然後在layout下的檔案裡在 drawable;backgroud=“@drawable/repeat_bg”