android background repeat-y

我是研究僧i 提交于 2019-12-06 08:39:44

I use the following code for repeating a image on y axis as background:

 <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"
    />

For seperate TileModes for X and Y u need to do this in code:

    BitmapDrawable TileMe = new BitmapDrawable(BitmapFactory.decodeResource(getResources(), R.drawable.listbackground));
      //TileMe.setTileModeX(TileMode.REPEAT);
      TileMe.setTileModeY(TileMode.REPEAT);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!