將元素添加到佈局(本例中爲LinearLayout)時,元素的兩側會有一個空白區域,但屬性layout_width是「 match_parent」。爲什麼?Android - LinearLayout右側和右側的空白空間
以下是截圖: http://s32.postimg.org/o4vr8kzbp/device_2016_07_30_001720.png 代碼:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="500dp"
android:background="@color/blue"
android:orientation="vertical">
</LinearLayout>
</LinearLayout>
不禁不看,你已經嘗試過。發佈xml文件。 – Nerd
@Nerd是的,我發佈了它。 – Fidelis