3

右に配置してy軸に繰り返したい画像があります。HTMLの「background:url(img.png)rightrepeat-y」のようなもの。

Androidでこれを行うことは可能ですか?

このビットマップを背景として設定すると、正しくありません。

<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
  android:src="@drawable/img_list"
  android:filter="true"
  android:dither="true"
  android:tileMode="repeat"
  android:gravity="right" />
4

1 に答える 1

1

次のコードを使用して、y軸上の画像を背景として繰り返します。

 <bitmap xmlns:android="http://schemas.android.com/apk/res/android"
        android:src="@drawable/background"
        android:tileMode="repeat"
        android:antialias="true"
        android:dither="false"
        android:filter="false"
        android:gravity="left"
    />

XとYの個別のTileModeの場合、コードでこれを行う必要があります。

    BitmapDrawable TileMe = new BitmapDrawable(BitmapFactory.decodeResource(getResources(), R.drawable.listbackground));
      //TileMe.setTileModeX(TileMode.REPEAT);
      TileMe.setTileModeY(TileMode.REPEAT);
于 2012-06-14T15:47:01.153 に答える