ShapeDrawable
Android:有没有办法在 xml中指定 a 的宽度和高度?这似乎异常困难。使用的<size>
子级不起作用,将其包装<shape>
在图层列表项以及设置android:height
和android:weight
属性中也不起作用。
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<!--
How do you set shape size?
The top/bottom attributes allow setting size via an inset
from the parent element, but isn't there way to explicitly
set width and height???
-->
<item
android:bottom="0dp"
android:left="0dp"
android:right="0dp"
android:top="0dp">
<shape android:shape="rectangle" >
<solid android:color="#f00" />
<stroke
android:width="1dp"
android:color="#0f0" />
</shape>
</item>
</layer-list>