Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: 如何使用现有自定义主题在 XML 中隐藏 Activity 的标题栏
当我在我的设备或模拟器上运行我的应用程序时,我可以在屏幕顶部看到活动名称,例如 MainActivity 或 Hello World 之类的,我想删除它,但我不知道如何。我应该在 xml 文件中写些什么吗?
活动标题栏(因为这就是您所指的)可以通过在活动声明中添加适当的主题来从清单中隐藏:
android:theme="@android:style/Theme.NoTitleBar"
或从代码中,通过调用
requestWindowFeature(Window.FEATURE_NO_TITLE);
在活动的onCreate()
onCreate()