1

レイアウトに関する奇妙な問題に直面しています。私のアプリケーションでは、アクティビティのレイアウトが多数あり、それらはすべて同じ背景色、つまり灰色です。これらのレイアウトはすべて、4.x デバイスの場合にのみわずかに異なるマップ画面の 1 つのレイアウトを除いて、すべてのデバイスで期待どおりに機能しています。4.x デバイスでは、画面が他の画面よりも暗く表示されます。暗さは、ダイアログが表示されているときのようなものです。

画面のレイアウトは次のとおりです。

        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@color/grey"
    android:orientation="vertical"
    android:paddingBottom="5dp"
    android:paddingLeft="10dp"
    android:paddingRight="10dp"
    android:paddingTop="10dp" >


    <FrameLayout
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_marginBottom="5dp"
        android:layout_weight="1"
        android:paddingBottom="10dip"
        android:paddingLeft="10dip"
        android:paddingRight="10dip"
        android:paddingTop="10dip" >

        <com.readystatesoftware.maps.TapControlledMapView
            android:id="@+id/mapview"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:apiKey="@string/mapApiKey"
            android:clickable="true" />

        <TextView
android:id="@+id/uselessTextView
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" 
            android:background="@drawable/itemlistbackground"/>
    </FrameLayout>


</LinearLayout>

主な問題は、上記のレイアウトのフレーム レイアウトにあります。ID「uselessTextView」のテキストビューの背景を黒い画像、つまり itemlistbackground に設定すると、画面の外観は問題ありません。

ただし、そのtextView、つまりidがuselessTextViewのtextviewを削除すると、画面が通常より少し暗くなります(ダイアログが表示されているときと同じです)。

上記のコードにテキストビューを配置すると、マップがそのアクティビティの主な機能であるため、望ましくないマップビューが非表示になるため、上記のコードに黒い背景は必要ありません。しかし、そうすると、画面が少し暗くなります。

問題を解決するのを手伝ってください。

4

0 に答える 0