1

我一直面临着一个奇怪的布局问题。在我的应用程序中,有许多活动布局,它们都具有相同的背景颜色,即灰色。所有这些布局在所有设备中都按预期工作,除了一种布局,即在地图屏幕中,仅在 4.x 设备的情况下略有不同。与 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>

主要问题在于上述布局中的framelayout。每当我将带有 id 'uselessTextView' 的文本视图的背景设置为黑色图像时,即 itemlistbackground ,屏幕外观就可以了。

但是,当我删除该 textView 即带有 id uselessTextView 的 textview 时,屏幕看起来比平时稍微暗淡(暗淡与显示对话框时相同)。

我不想在上面的代码中使用黑色背景,因为将 textview 放在上面的代码中会隐藏不需要的 mapview,因为 map 是该活动的主要特征。但如果我这样做,屏幕会稍微变暗。

请帮我解决问题。

4

0 回答 0