我想在我的应用程序工具栏中显示特定文本,但它也总是显示应用程序的名称。我怎样才能摆脱应用名称和 TextView
的文本?
<android.support.design.widget.AppBarLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:theme="@style/AppTheme.AppBarOverlay"
android:fitsSystemWindows="true" >
<android.support.v7.widget.Toolbar
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:popupTheme="@style/AppTheme.PopupOverlay"
android:fitsSystemWindows="true" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="The title I want to show"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true" />
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
最佳答案
在 AndroidManifest.xml 文件中为 Activity 声明添加标签。
<activity
....
android:label="Name of Your Screen"
....
</activity>
关于java - Android 应用始终在工具栏中显示应用名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41320456/