12

私は単純なレイアウト構造を持っています:

DrawerLayout
\-- FrameLayout // @+id/fragment_container
\-- ListView    // @+id/drawer_list

ドロワー項目をクリックすることで、対応する Fragment インスタンスを介しFragmentTransaction.replace()てフラグメントを挿入/置換します。R.id.fragment_containerこれらのフラグメントの 1 つに が含まれていますMapView

また、さまざまなデバイスでレンダリングの問題がありますが、同時に DDMS は正しいスクリーンショットを表示します。

編集済み

次のようなデバイスで問題が発生します。

  • ファーウェイ U9508、アンドロイド 4.0.4 (API 15)
  • HTC 欲望 A9191、アンドロイド 2.3.5 (API 10)

そのようなデバイスにはありno issueます:

  • CyanogenMod Android 4.2.2 (API 17) を搭載したSamsung Galaxy S2
  • LG Google ネクサス 4 Android 4.3 (API 18)

この問題を理解して修正するのを手伝ってくれる人はいますか?

画像を参照してください:

ファーウェイ U9508、アンドロイド 4.0.4 (API 15)

ここに画像の説明を入力 ここに画像の説明を入力 ここに画像の説明を入力

HTC 欲望 A9191、アンドロイド 2.3.5 (API 10)

ここに画像の説明を入力

DDMS

ここに画像の説明を入力

編集済み

活動のレイアウト:

<?xml version="1.0" encoding="utf-8"?>
<DrawerLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/drawer"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        >

    <!-- The main content view -->
    <FrameLayout
            android:id="@+id/fragment_container"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            />

    <!-- The navigation drawer -->
    <ListView
            android:id="@+id/drawer_list"
            android:layout_width="240dp"
            android:layout_height="match_parent"
            android:orientation="vertical"
            />
</DrawerLayout>

フラグメント レイアウト:

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

    <!-- other views here -->

    <com.google.android.gms.maps.MapView
            android:id="@+id/consumer_profile_map"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            />
</RelativeLayout>
4

1 に答える 1

30

したがって、回避策を見つけます。MapViewコンテナにラップして、上に空を置くだけViewです。この回答のおかげで: https://stackoverflow.com/a/16231935/1891118

私の更新されたレイアウトがあります:

<FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        >

    <com.google.android.gms.maps.MapView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            />

    <View
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            />
</FrameLayout>
于 2013-10-14T07:20:33.673 に答える