简体   繁体   English

如何在应用程序中隐藏标题文本?

[英]How do I hide title text in application?

In my app I am using a logo instead of an icon at the top using android:logo="@drawable/logo" in in the manifest file. 在我的应用中,清单文件中的android:logo =“ @ drawable / logo”使用顶部的徽标而不是图标。 The only problem is that the title text of the application still shows up next to it. 唯一的问题是应用程序的标题文本仍显示在其旁边。 I have seen some solutions, but none that can be done with my current API minimum of 5 which I am wanting to keep. 我已经看到了一些解决方案,但是我想保留的当前最少5个API都无法解决。 How do I do so? 我该怎么做? And please don't suggest setting android:label="" as many suggested in other similar questions, as this makes the launcher icon not have a label as well. 并且,建议不要像其他类似问题中建议的那样设置android:label =“”,因为这会使启动器图标也没有标签。

只需将此行添加到您的活动onCreate

setTitle("");

What about this: use in onCreate: 那怎么办:在onCreate中使用:

requestWindowFeature(Window.FEATURE_NO_TITLE);

This will hide your icon and title. 这将隐藏您的图标和标题。 Now add one linear or relative layout containing only icon above other elements in your layout files. 现在,在布局文件中的其他元素上方添加一个仅包含图标的线性或相对布局。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Android中隐藏应用程序标题? - How to hide application title in Android? 如何在Android应用程序中隐藏标题栏 - How can I hide the title bar in an android application 如何对带有数字的文本列进行排序(标题 1、标题 2、...) - How do I sort a text column with numbers (title 1, title 2, ...) 如何在 Android(使用 Nativescript)中将 ActionBar 标题文本居中? - How do I center ActionBar title text in Android (with Nativescript)? 如何在ActionBarSherlock 4.0中设置标题文本的样式? - How do I style the title text in ActionBarSherlock 4.0? 在Google TV上,如何使“全屏活动”正确隐藏标题和按钮? - On Google TV How do I make Fullscreen Activity hide title and button properly? 如何在第一个文本标题周围包裹第二个文本,两个文本都在文本视图中 - How do I wrap a second text around first text title, both are in text view 如何通过覆盖应用程序样式以特定的活动样式隐藏标题栏 - How to hide the title bar in a particular activity style by overriding the Application Style 当文本视图从屏幕隐藏时,如何设置工具栏标题? - How to set toolbar title when a text view hide from screen? 如何隐藏标题Android - How to hide Title Android
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM