我刚刚开始与Android。我正在用按钮进行布局,但发生了一件非常奇怪的事情 - 它们之间有一个小小的差距。将边距和填充设置为0也无济于事。Android:按钮之间奇怪的差距
这里是我的简单的布局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical">
<Button
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
<Button
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
</LinearLayout>
这是因为按钮9.path可绘制有小幅度... –
@dieter_h我试图将边缘设置为0,它没有帮助。 – Dizzy
我现在无法检查,但它可能只是其中有填充的按钮的drawable(请参阅顶部和底部也有填充)。如果你不喜欢它,请画出我们的9补丁并将其设置为背景。 –