【问题标题】:Is it possible to change android background black colour?是否可以更改android背景黑色?
【发布时间】:2012-02-22 17:33:49
【问题描述】:

是否可以在活动之间切换时更改背景颜色? 我的意思是黑色在其中一项活动消失和第二项活动出现之前出现。谢谢。

【问题讨论】:

  • 你如何切换活动?这听起来不像典型的 Android 行为。
  • 这是默认切换,我没有放任何动画,没有overridePendingTransition。只是想知道我是否可以改变黑色?

标签: android colors background default


【解决方案1】:

您只需要前往 activity_home.xml 在代码的起始行添加此背景参数以设置屏幕黑色

android:background="#ffffff"

【讨论】:

    【解决方案2】:

    您可以按如下方式更改您正在使用的主题:

    application android:icon="@drawable/icon" android:label="@string/app_name"
        android:theme="@android:style/Theme.Light" >
    

    编辑 如文档中所述:

    <application android:theme="@style/CustomTheme">
    

    然后调整你喜欢的主题:

    <style>
    <color name="custom_theme_color">#b0b0ff</color>
    <style name="CustomTheme" parent="android:Theme.Light">
    <item name="android:windowBackground">@color/custom_theme_color</item>
    <item name="android:colorBackground">@color/custom_theme_color</item>
    </style>
    

    这里是主题http://developer.android.com/guide/topics/ui/themes.html#ApplyATheme的链接

    【讨论】:

    • 和自定义一个?我需要活动之间的灰色背景?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-28
    • 2015-07-18
    • 1970-01-01
    • 2020-04-03
    • 2014-01-30
    • 1970-01-01
    相关资源
    最近更新 更多