我想在夏洛克动作栏中更改自定义后退按钮并删除应用程序图标 [英] I want to change the custom back button in sherlock action bar and remove app icon
问题描述
我不喜欢带有动作条的默认后退按钮,它们看上去太小了,不符合我的喜好。我试图修复一个更大,更具描述性的按钮,例如微信移动应用程序中使用的按钮。
请任何有想法的人。
I dont like the default back button that comes with action bars they look rather to tiny for my liking. I trying to fix a bigger and more descriptive button like the one used in the WeChat Mobile App. please any body with an Idea.
我在下面尝试过此方法,但没有用
I tried this below but did not work
<item name="android:homeAsUpIndicator">@drawable/back</item> //Put in my style
代码中的以下那个
ActionBar actionBar = getSupportActionBar();
actionBar.setHomeButtonEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
// actionBar.setDisplayUseLogoEnabled(false);
actionBar.setDisplayUseLogoEnabled(true);
但没有用。我保存在可绘制对象中的图像没有显示。我的应用程序图标在我不想要的操作栏上保持显示。并且后退按钮不起作用。请任何想法。
But did not work. the image that I kept in my drawable is not show. My app icon keeps show on the action bar which I dont want. and the back button is not working. Please any idea.
推荐答案
尝试一下:
<style name="YourTheme" parent="@style/Theme.Sherlock.Light.DarkActionBar">
<item name="homeAsUpIndicator">@drawable/new_indicator</item>
<item name="android:homeAsUpIndicator">@drawable/new_indicator</item>
</style>
<$ c中的 new_indicator
xml文件$ c> drawable 文件夹:new_indicator.xml
And new_indicator
xml file in drawable
folder: new_indicator.xml
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:left="0dp"
android:right="5dp">
<bitmap android:src="@drawable/indicator" /> <!-- this is your desired image -->
</item>
</layer-list>
这篇关于我想在夏洛克动作栏中更改自定义后退按钮并删除应用程序图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!