XML drawable Bitmap tileMode bug?

后端 未结 2 779
时光取名叫无心
时光取名叫无心 2020-12-03 05:35

I\'m having issues where my drawable resource uses the tileMode repeat. In some cases the image is just stretched and sometimes it is properly repeated.

The followi

相关标签:
2条回答
  • 2020-12-03 05:47

    This is a known bug, partially fixed in Android 3.0 and completely fixed in ICS.

    0 讨论(0)
  • We were having a similar problem writing for 3.2 on Sony's Google TV device. We noticed some very similar background-striping stemming from using android:tileMode="repeat" on a bitmap as a background image.

    In this case, the fix was to turn off hardware acceleration on the view that contained the bitmap like so (from a function in our Activity):

    View tile_holder = this.findViewById(R.id.tile_holder);
    tile_holder.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
    
    0 讨论(0)
提交回复
热议问题