Android: ShapeDrawable
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>