Android控件底部边框一条固定长度的线绘制

Android控件底部边框一条固定长度的线绘制_第1张图片


<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true" android:state_selected="false">
        <shape>
            <solid android:color="#cccccc" />
        shape>
    item>

    <item android:state_pressed="true" android:state_selected="true">
        <layer-list>
            <item >
                <shape android:shape="rectangle">
                    <solid android:color="#cccccc" />
                shape>
            item>
            <item android:width="30dp" android:height="2dp" android:gravity="bottom|center">
                <shape android:shape="rectangle">
                    <corners android:radius="3dp" />
                    <solid android:color="@color/dark_sky_blue" />
                shape>
            item>
        layer-list>
    item>

    <item android:state_pressed="false" android:state_selected="true">
        <layer-list>
            <item android:width="30dp" android:height="2dp" android:gravity="bottom|center">
                <shape android:shape="rectangle">
                    <corners android:radius="3dp" />
                    <solid android:color="@color/dark_sky_blue" />
                shape>
            item>
        layer-list>
    item>

selector>

你可能感兴趣的:(Android,html,javascript,前端)