我试着@IulianVărzaru说了什么,并删除了一点点的填充。
顺便说一句,我认为填充是从您的android:background="@android:color/holo_red_dark"
来这里,你可以与@IulianVărzaru看到提示:
下面的代码:
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="180dp"
android:background="@android:color/holo_red_dark"
android:includeFontPadding="false"
android:padding="0dp"
android:text="New Button" />
但是,如果我们删除它:
下面的代码:
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="180dp"
android:includeFontPadding="false"
android:padding="0dp"
android:text="New Button" />
所以,我的建议是使用自己的风格着色它象下面这样:
How to set Style for a button in Android?
或者,在样式中<item name="android:colorButtonNormal">#FF9800</item>
。
最后,在这里你可以看到好的结果:
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="180dp"
android:text="New Button" />
谢谢,这有帮助。我有事件设置0dp肯定:) – seelts