【问题标题】:Android layer-list item height not workingAndroid层列表项高度不起作用
【发布时间】:2016-08-26 15:59:58
【问题描述】:

我得到了这个drawable,它只是在底部做了一个漂亮的边框。
我这样做是为了获得比矩形边框更闪亮的东西。

代码适用于 API 24。
在 API 23 上它不显示。
在此之下,高度不起作用,它只会填满所有内容。

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:height="3dp"
        android:left="5dp"
        android:right="5dp"
        android:gravity="bottom">
        <shape
            android:shape="oval">
            <gradient
                android:angle="90"
                android:startColor="#000000"
                android:centerColor="@android:color/transparent"/>
        </shape>
    </item>
</layer-list>

【问题讨论】:

    标签: android android-drawable


    【解决方案1】:

    没有真正解决问题,但找到了解决方法。

    <View
         android:layout_width="match_parent"
         android:layout_height="3dp"
         android:background="@drawable/borderbottom"
         android:layout_alignParentBottom="true" />
    

    【讨论】:

      猜你喜欢
      • 2011-01-18
      • 2016-04-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-01
      • 1970-01-01
      相关资源
      最近更新 更多