-1
我有一個錯誤「這的LinearLayout佈局或其的FrameLayout父是無用的」在線沒有21和錯誤「在LinearLayout中無效的佈局PARAM:layout_centerHorizontal」在線29和30我在下面的代碼中有多個錯誤。下面列出的錯誤。任何方案?
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<fragment android:id="@+id/peta"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.SupportMapFragment"/>
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="96dip"
android:orientation="vertical"
android:weightSum="2" >
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:id="@+id/spinner_list_smk">
</Spinner>
</LinearLayout>
</FrameLayout>
layout_centerHorizontal和layout_centerVertical這些屬性在RelativeLayout中使用,而不是在LinearLayout中使用android:gravity =「center」 –