1

線形レイアウトを別の線形レイアウトに埋め込もうとしています。マップビューがあります。マップビューの後に埋め込みレイアウトを配置すると、機能しません。私がそれをする前にそれを置くならば?なぜ、そして私は何をすべきですか?

以下に示す2つのファイル:最初の1つは失敗します。2つ目は機能しますか?でも最初のものが欲しいです。

<!--two files.  

The first file does not work.  The Check Boxes in an embeded linear layout is below the mapview.  It only shows map view.  

The second file works.  The Check Boxes in an embeded linear layout is ABOVE the mapview.-->

<!-- FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE FILE ONE-->

<?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" 
    android:background="#A971E5" >


    <com.google.android.maps.MapView
        android:id="@+id/mapWhenImClose"    
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:clickable="true"
        android:apiKey="0MbR34udiEJdnkplC1F7rK4ZxbSFzdRagCruFDA"/>
        <!--  had this line but it said depreciated        
        android:enabled="true" -->

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" 
        android:orientation="horizontal">

        <CheckBox
            android:id="@+id/chkShowStreetView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/strShowStreetView" />

        <CheckBox
            android:id="@+id/chkShowSatelliteView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/strShowSatelliteView" />

    </LinearLayout>



</LinearLayout>


<!--File Two File Two File Two File Two File Two File Two File Two File Two File Two File Two File Two File Two File Two File Two File Two File Two File Two File Two File Two File Two File Two File Two File Two File Two File Two File Two File Two File Two File Two File Two File Two File Two File Two File Two File Two File Two File Two File Two File Two-->


<?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" 
    android:background="#A971E5" >


    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" 
        android:orientation="horizontal">

        <CheckBox
            android:id="@+id/chkShowStreetView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/strShowStreetView" />

        <CheckBox
            android:id="@+id/chkShowSatelliteView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/strShowSatelliteView" />

    </LinearLayout>


    <com.google.android.maps.MapView
        android:id="@+id/mapWhenImClose"    
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:clickable="true"
        android:apiKey="0MbR34udiEJdnkplC1F7rK4ZxbSFzdRagCruFDA"/>
        <!--  had this line but it said depreciated        
        android:enabled="true" -->

</LinearLayout>

http://pastebin.com/Tfsec1Mh

4

1 に答える 1

1

画面MapView全体を次のようにカバーしますandroid:layout_height="fill_parent"

<com.google.android.maps.MapView
        android:id="@+id/mapWhenImClose"    
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:clickable="true"
        android:apiKey="0MbR34udiEJdnkplC1F7rK4ZxbSFzdRagCruFDA"/>
        <!--  had this line but it said depreciated        
        android:enabled="true" -->

編集:

<?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#A971E5" >

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" 
        android:orientation="horizontal"
        android:id="@+id/thebar" 
        android:layout_alignParentBottom="true">

        <CheckBox
            android:id="@+id/chkShowStreetView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/strShowStreetView" />

        <CheckBox
            android:id="@+id/chkShowSatelliteView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/strShowSatelliteView" />

    </LinearLayout>


    <com.google.android.maps.MapView
        android:id="@+id/mapWhenImClose"    
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_alignParentTop="true"
        android:layout_above="@id/thebar"
        android:clickable="true"
        android:apiKey="0MbR34udiEJdnkplC1F7rK4ZxbSFzdRagCruFDA"/>
        <!--  had this line but it said depreciated        
        android:enabled="true" -->

</RelativeLayout>
于 2012-05-19T19:13:55.950 に答える