Android 沿屏幕宽度均匀分布的按钮
我知道有几个问题同名,但我有一个不同的问题。我已经让它工作了,当我没有对按钮应用颜色时,它们在屏幕底部的间隔是完美的。当我应用一种颜色时,它们之间的间隙将填充。它们仍然占据着屏幕,你无法分辨一个在哪里停止,另一个在哪里开始。我试着使用左右填充,但没有任何区别。这就是我的工作Android 沿屏幕宽度均匀分布的按钮,android,xml,Android,Xml,我知道有几个问题同名,但我有一个不同的问题。我已经让它工作了,当我没有对按钮应用颜色时,它们在屏幕底部的间隔是完美的。当我应用一种颜色时,它们之间的间隙将填充。它们仍然占据着屏幕,你无法分辨一个在哪里停止,另一个在哪里开始。我试着使用左右填充,但没有任何区别。这就是我的工作 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.an
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:background="@drawable/calm"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".PiktuurMain"
>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
>
<Button
android:id="@+id/button1"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:background="@color/buttonColor"
android:text="Button" />
<Button
android:id="@+id/button2"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:background="@color/buttonColor"
android:text="Button" />
<Button
android:id="@+id/button3"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:background="@color/buttonColor"
android:text="Button" />
</LinearLayout>
</RelativeLayout>
将layoutMarginLeft和layoutMarginRight放在中间按钮上约10dp。如果你能发布屏幕截图,最好预测你的问题