Advanced android layout: making a ListView divider from a layer-list

后端 未结 1 1015
滥情空心
滥情空心 2021-02-04 21:37

Refer to the image below to understand what I\'m trying to do. It should be obvious from the image provided. It seems like this should be pretty simple.

The question is,

相关标签:
1条回答
  • 2021-02-04 22:09

    I ended up abandoning the repeat tile mode and did it like this instead:

    <?xml version="1.0" encoding="utf-8"?>
    <layer-list
        xmlns:android="http://schemas.android.com/apk/res/android" >
        <item>
            <bitmap
                android:src="@drawable/bg"
                android:tileMode="repeat" />
        </item>
        <item>
            <bitmap
                android:src="@drawable/shelf_shine"/>
        </item>
        <item>
            <bitmap
                android:src="@drawable/shelf_middle_stretch"
                android:gravity="bottom|fill_horizontal"/>
        </item>
        <item>
            <bitmap
                android:src="@drawable/shelf_side_left"
                android:gravity="left|bottom"/>
        </item>
        <item>
            <bitmap
                android:src="@drawable/shelf_side_right"
                android:gravity="right|bottom"/>
        </item>
        <item>
            <bitmap
                android:src="@drawable/shelf_left"
                android:gravity="left|bottom"/>
        </item>
        <item>
            <bitmap
                android:src="@drawable/shelf_right"
                android:gravity="right|bottom"/>
        </item>
    </layer-list>
    
    0 讨论(0)
提交回复
热议问题