gpt4 book ai didi

android - 主题背景

转载 作者:行者123 更新时间:2023-11-30 03:44:30 26 4
gpt4 key购买 nike

我需要为应用中的每个 Activity 设置背景颜色。我宁愿在全局范围内设置它。为此,我更改了设置为应用程序主题的样式。

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

问题是,现在所有没有指定背景的 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。我该如何解决这个问题?

最佳答案

在 ImageView xml 中包含这一行:

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

关于android - 主题背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15221289/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com