BitmapDrawable を使用できない理由は、サンプル コードです。
<?xml version="1.0" encoding="utf-8"?>
<bitmap
xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/drawable_resource"
android:gravity="center"
android:tileMode="repeat"/>
- 描画可能な src 名に置き換えて、これを .xml ファイルとして保存するだけです。
- ファイルを res/drawable ディレクトリに保存します。
- 参照を割り当てる
android:background="@drawable/drawable_resource"
と、タイル表示されます。
例:
<LinearLayout
android:background="@drawable/drawable_resource"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
</LineatLayout
ここに Bitmap Drawable の完全なテンプレートがあり、必要に応じて属性値を選択できます。
<?xml version="1.0" encoding="utf-8"?>
<bitmap
xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@[package:]drawable/drawable_resource"
android:antialias=["true" | "false"]
android:dither=["true" | "false"]
android:filter=["true" | "false"]
android:gravity=["top" | "bottom" | "left" | "right" | "center_vertical" |
"fill_vertical" | "center_horizontal" | "fill_horizontal" |
"center" | "fill" | "clip_vertical" | "clip_horizontal"]
android:tileMode=["disabled" | "clamp" | "repeat" | "mirror"] />
XML ビットマップについては、ここで同じ外観のドキュメントを見つけることができます。