我正在开发一个有设计要求的应用程序,因为它应该只在 ActionBar 上有标题,而不是应用程序图标。
我尝试了从 StackOverflow 找到的各种解决方案,例如
getActionBar().setDisplayUseLogoEnabled(false);
getActionBar().setDisplayShowHomeEnabled(false);
getActionBar().setIcon(null);
然而到目前为止,这些都不起作用,即使我尝试通过制作透明的 ic_launcher 图标并将其放入 manifest.xml 来进行破解/修复,但它会导致应用程序安装图标变得透明。
请帮忙
getActionBar().setDisplayShowHomeEnabled(false);
works perfectly in 4.4 kitkat , but showing a back arrow in downgraded version like this
我需要这样才能在每个设备上工作
请尝试添加这个..
getActionBar().setDisplayHomeAsUpEnabled(true);
getActionBar().setHomeButtonEnabled(true);
并在你的主题中添加
<style name="CustomActionBarTheme"
parent="@android:style/Theme.Holo.Light.DarkActionBar">
<item name="android:actionBarStyle">@style/ActionBar</item
</style>
<!-- ActionBar styles -->
<style name="ActionBar"
parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
<item name="android:icon">@android:color/transparent</item>
</style>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)