android shape 怎么在底部画横线

使用layer-list可以,画了两层

1
2
3
4
5
6
7
8
9
         < layer-list >
             <!-- This is the line -->
             < item  android:left = "8dp"  android:right = "8dp" >< shape >
                     < solid  android:color = "@color/black"  />
                 </ shape ></ item >
             < item  android:bottom = "3dp" >< shape >
                     < solid  android:color = "@color/white"  />
                 </ shape ></ item >
         </ layer-list >

优点 :  可以控制宽度

猜你喜欢

转载自www.cnblogs.com/zmc/p/9389934.html