0

如何为android上的按钮设置不同的宽度?像顶部和底部是 2dp 但左右是 4dp?谢谢你。

更新:

如果我的问题不清楚,我很抱歉。它不是边距或填充。但我想自定义宽度,如css中的border-top或border-left。在安卓中可以吗?

4

1 回答 1

1

你的问题不清楚。你看起来像下面的东西吗?

<Button 
android:text="Button"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp" 
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:id="@+id/button1" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content">
</Button>
于 2011-08-09T10:09:43.653 回答