简体   繁体   English

如何隐藏应用程序图标,但在Action Bar Android中保持向上按钮

[英]How to hide App icon but keep Up button in Action Bar Android

I am programming an application which using Slide Bar. 我正在编写一个使用Slide Bar的应用程序。 I tried a sample from Google with Navigation Drawer. 我使用导航抽屉尝试了Google的示例。

Here is link download: 这是链接下载:

http://developer.android.com/shareables/training/NavigationDrawer.zip However I meet a problem. http://developer.android.com/shareables/training/NavigationDrawer.zip然而我遇到了一个问题。 My application doesn't need Application Icon(ic_launcher.png) but keep Up button (ic_drawer.png). 我的应用程序不需要应用程序图标(ic_launcher.png),但保持向上按钮(ic_drawer.png)。

I hide title by using: getActionBar().setDisplayShowTitleEnabled(false); 我通过使用: getActionBar().setDisplayShowTitleEnabled(false);隐藏标题getActionBar().setDisplayShowTitleEnabled(false); and setDisplayShowHomeEnabled(false) but It's doesn't hide App Icon. setDisplayShowHomeEnabled(false)但它不会隐藏App Icon。

Please help me solve this problem. 请帮我解决这个问题。 This sample project doesn't have "style.xml" file 此示例项目没有“style.xml”文件

你可以试试

actionbar.setIcon(R.color.transparent);

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

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