不久出现在启动导航抽屉力的应用程序名称和图标出现在、抽屉、应用程序、图标

2023-09-03 22:28:49 作者:天涯亦孤行

我每次启动应用程序,应用程序的名称和图标出现很快在左侧在抽屉图标。该遗址自定义动作条风格的外观。

Each time I start the app, the application name and icon appears very shortly on the left side over the drawer icon. This ruins the look of the custom ActionBar style.

我怎么能删除吗?我已经尝试从计算器上的解决方案,但它们都涉及到完全隐藏动作条。我不想掩饰它,因为我需要它。我只是不知道在哪里可以关闭这个恼人的显示。

How can I remove it? I already tried the top solution from StackOverflow, but they all refer to completely hiding the ActionBar. I don't want to hide it as I need it. I just don't know where to turn off this irritating display.

注:我已经让Android的Studio中创建的抽屉式导航栏项目对我来说,这样所有的code来自默认创建。

Note: I've let the Android Studio create the Navigation Drawer project for me so all the code came from the default creation.

修改

这是出现在3个地点的code: restoreActionBar 设置 showGlobalContextActionBar 。我说的是默认的Andr​​oid工作室抽屉里的项目。

This is the code which appears in 3 locations: restoreActionBar, setUp and showGlobalContextActionBar. I am talking about the default Android Studio drawer project.

public void restoreActionBar() {
    ActionBar actionBar = getActionBar();
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
    actionBar.setDisplayShowTitleEnabled(false);
    actionBar.setDisplayShowHomeEnabled(false);
    actionBar.setDisplayHomeAsUpEnabled(false);

// actionBar.setTitle(mTitle);     }

// actionBar.setTitle(mTitle); }

推荐答案

最好的方法是设置为 useLogo 的显示选项在你的主题。例如,

Best method is to set the display options to useLogo in your theme. E.g.

<style name="AppTheme" parent="android:Theme.Holo.Light">
    <item name="android:actionBarStyle">@style/AppTheme.ActionBar</item>
</style>

<style name="AppTheme.ActionBar" parent="android:Widget.Holo.Light.ActionBar.Solid">
    <item name="android:displayOptions">useLogo</item>
</style>

这不会实际显示的标志(如果设置),因为 showHome 不包括在内。

This won't actually show the logo (if set) because showHome is not included.