2013-03-05 67 views
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> 

的问题是,现在所有ImageViews和TextViews还没有一个指定的背景获取应用程序的背景,而不是父布局的背景下,例如

<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。我怎么解决这个问题?

回答

1

包括关于ImageView的XML这一行:

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

好,谢谢,正确的拼写是机器人:背景= “@机器人:彩色/透明” 未经的 “颜色” – crbin1 2013-03-05 11:05:28

+0

感谢 “S”。编辑。你懂。我用心打字,发生了这些事情。 – Budius 2013-03-05 11:19:01