简体   繁体   English

想要在屏幕顶部删除textview

[英]want to remove textview on top of screen

How to remove textview right under status bar?. 如何删除状态栏下方的textview? Its used to display app name by default. 默认情况下,它用于显示应用程序名称。 Even I delete main.xml, it does not work. 即使删除main.xml,它也无法正常工作。 I want move up widgets after removing textview. 我想在删除textview后向上移动小部件。

Thanks 谢谢

The textview you are talking about is knowing as Title bar of the application, which is mostly used to display title of current activity. 您正在讨论的textview被称为应用程序的标题栏 ,该主要用于显示当前活动的标题。

Programmatically: 以编程方式:

//Remove title bar
this.requestWindowFeature(Window.FEATURE_NO_TITLE);

 //Remove status bar
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

Design time: just make changes inside the AndroidManifest.xml file 设计时间:只需在AndroidManifest.xml文件中进行更改

<activity android:name=".MainActivity"
          android:label="@string/app_name"
          android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">

You want to remove the title bar of your app. 您要删除应用程序的标题栏。 Add this to your manifest file in application tag: 将此添加到应用程序标记中的清单文件中:

android:theme="@android:style/Theme.NoTitleBar"

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM