摆脱 Activity 顶部的渐变(Android) [英] Getting rid of the gradient at the top of an Activity (Android)

查看:26
本文介绍了摆脱 Activity 顶部的渐变(Android)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何去除屏幕顶部的渐变(下方屏幕截图中蓝色的最顶部...通知栏下方)?

How can I get rid of the gradient at the top of my screen (the very top of the blue in the screenshot below... below the notification bar)?

简单截图 http://dl.dropbox.com/u/299320/device.png

推荐答案

This isable;查看 windowContentOverlay 属性.特别是,您可以创建一个新的主题:

This is themable; look at the windowContentOverlay attribute. In particular, you can create a new theme:

<style name="Theme.Foo" parent="android:style/Theme.Light">
    <item name="android:windowContentOverlay">@null</item>
</style>

然后声明你的活动应该使用这个主题:

And then declare that your activity should use this theme:

<activity android:name=".FooActivity"
          android:theme="@style/Theme.Foo"> ...

虽然更好的选择是为应用程序中的所有活动设置这个主题,以保持一致性:

Although a better option is to set this theme for all activities in the application, for consistency:

<application android:theme="@style/Theme.Foo"> ...

这篇关于摆脱 Activity 顶部的渐变(Android)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆