how can I set different width for a button on android? Like top and bottom are 2dp but le开发者_运维技巧ft and right are 4dp? Thank you.
Update:
My apology if my question is unclear. It is not margin or padding. But I would like to customise the width like border-top or border-left in css. Is it possible in android?
Your question is not clear.Are you looking something like following?
<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>
精彩评论