我有以下布局。
<?xml version="1.0" encoding="utf-8"?>
<Button
android:id="@+id/sign_in"
style="@style/ButtonText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/custom_button_green"
android:text="@string/signin_via_email"
android:textSize="15sp"
android:typeface="sans" />
现在我并不希望按钮占满整个宽度,而是想要左边和右边各有10dp的边距。我已经设置了padding和layout_marginLeft及right属性,但它们似乎不起作用。请问有什么帮助吗?
谢谢!
android:layout_width="wrap_content"
并相应地指定边距。 - neevek