如何隐藏一个活动的XML与现有的自定义主题的标题栏 [英] How to hide the title bar for an Activity in XML with existing custom theme

查看:162
本文介绍了如何隐藏一个活动的XML与现有的自定义主题的标题栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要隐藏标题栏的我的一些活动。问题是,我申请一个风格,我所有的活动,所以我不能简单地设立了主题为@android:款式/ Theme.NoTitleBar。

I want to hide the titlebar for some of my activities. The problem is that I applied a style to all my activities, therefore I can't simply set the theme to @android:style/Theme.NoTitleBar.

使用NoTitleBar主题作为父母对我的风格,将去掉标题栏得多的活动。

Using the NoTitleBar theme as a parent for my style would remove the title bar for to much activities.

我可以在某处设置一个没有标题风格的项目?

Can I set a no title style item somewhere?

推荐答案

我现在做了以下。

我宣布一个风格继承了从我的大将风范,然后禁用标题栏。

I declared a style inheriting everything from my general style and then disabling the titleBar.

<style name="generalnotitle" parent="general">
    <item name="android:windowNoTitle">true</item>
</style>

现在我可以将这种风格到每一个活动中,我想隐藏标题栏重写应用广泛的风格和继承所有其他样式的信息,为此,在式的code无重复。

Now I can set this style to every Activity in which I want to hide the title bar overwriting the application wide style and inheriting all the other style informations, therefor no duplication in the style code.

这篇关于如何隐藏一个活动的XML与现有的自定义主题的标题栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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