0
我想从我的布局中删除这些汽车的利润,
这里是我的Layout.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:weightSum="3"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.shifz.bardofavon.MainActivity" >
<LinearLayout
android:weightSum="3"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:weightSum="2"
android:orientation="vertical"
android:layout_weight="2"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<Button
android:layout_weight="1"
android:id="@+id/b1"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:text="Quotes"
/>
<Button
android:layout_weight="1"
android:id="@+id/b2"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:text="Quotes"
/>
</LinearLayout>
<LinearLayout
android:weightSum="1"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<Button
android:layout_weight="1"
android:id="@+id/b3"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:text="MostWeight"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:weightSum="3"
android:layout_weight="2"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<Button
android:layout_weight="1"
android:id="@+id/b4"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Biography"
/>
<Button
android:layout_weight="2"
android:id="@+id/b5"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Biography"
/>
</LinearLayout>
我认为按钮将采取一些默认的边距,请尝试用LinearLayout替换Button并检查是否显示额外的空间。 – 2014-09-27 04:28:25
正确使用你的'weight'属性。 – Piyush 2014-09-27 04:34:07