Tiled drawable sometimes stretches

前端 未结 8 572
余生分开走
余生分开走 2020-11-29 20:59

I have a ListView whose items have a tiled background. To accomplish this, I use the following drawable xml:



        
相关标签:
8条回答
  • 2020-11-29 21:41

    I was also having the same issue. What I was missing was that we need to add scaletype to fitXY in the imageview for the xml bitmap to work properly.

    tile_bitmap.xml

    <bitmap
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:src="@drawable/tile"
        android:tileMode="repeat" />
    

    layout.xml

    <ImageView
        android:layout_width="match_parent"
        android:src="@drawable/tile_bitmap"
        android:layout_height="match_parent"
        android:scaleType="fitXY"/>
    
    0 讨论(0)
  • 2020-11-29 21:43

    This sounds like a bug, although I've never seen it myself. If you have a simple APK that reproduces the issue, please send it to me (romainguy /at/ android.com) or file a bug here.

    0 讨论(0)
提交回复
热议问题