入门处的活动的顶部去掉渐变(安卓) [英] Getting rid of the gradient at the top of an Activity (Android)

查看:118
本文介绍了入门处的活动的顶部去掉渐变(安卓)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能在我的屏幕上方摆脱梯度(下面的截图蓝色的顶部...通知栏下面)?

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

推荐答案

这是主题化;看 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"> ...

这篇关于入门处的活动的顶部去掉渐变(安卓)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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