[英]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.