1

アプリのすべてのアクティビティに背景色を設定する必要があります。グローバルに設定することをお勧めします。このため、アプリケーションのテーマとして設定されているスタイルを変更します。

<resources xmlns:android="http://schemas.android.com/apk/res/android">
    <style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
        <item name="android:background">@color/app_bg</item>
    </style>
</resources>

問題は、Background が指定されていないすべての ImageView と TextView が、親レイアウトの背景ではなく、アプリの背景を取得するようになったことです。たとえば、

<RelativeLayout 
    android:id="@+id/mmc_rl"
    android:layout_width="match_parent"
    android:layout_height="@dimen/mm_central_height"
    android:background="@color/main_menu_central_bg"> 

    <ImageView
        android:id="@+id/mmc_iv_goto"
        android:layout_width="@dimen/mm_central_height"
        android:layout_height="@dimen/mm_central_height"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:src="@drawable/button_goto_big3"  />

</RelativeLayout>

ImageView には背景があり、期待どおりapp_bgではありませんmain_menu_central_bg。どうすればこの問題を解決できますか?

4

1 に答える 1

1

この行をImageViewxmlに含めます。

android:background="@android:color/transparent"
于 2013-03-05T10:31:49.197 に答える