crbin1
crbin1

Reputation: 2229

Theme background

I need to set a background color to every activitity in my app. I would prefer to set it globally. For this reason I change the style setted as application theme.

<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>

The problem is that now all ImageViews and TextViews that have not a specified Background get the app background and not the background of parent Layout, for example

<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>

The ImageView has the background app_bg and not main_menu_central_bg as expected. How can I solve this problem?

Upvotes: 1

Views: 244

Answers (1)

Budius
Budius

Reputation: 39836

include this line on the ImageView xml:

android:background="@android:color/transparent"

Upvotes: 1

Related Questions