2015-11-27 62 views
0

我的应用程序使用带有ListView的Activity(扩展AppCompatActivity)。 标题行显示标题和后退箭头。删除ContextualActionBar中的后退箭头

ContextualActionBar被分配给ListView。 当ContextualActionBar被激活时,由于长按一下ListView的一个项目,后退箭头应该被移除。

请问任何人都可以给一个提示,如何去除ContextualActionBar的后退箭头?

非常感谢!

问候

乌利

回答

0

这不是真的建议删除向后的箭头,但你可以将其分配到一个透明的可绘制

<style name="MyCustomTheme" parent="MyTheme"> 
    <item name="android:actionModeCloseDrawable">@drawable/transparent_drawable</item> 
</style> 

哪里透明绘制的是:

<?xml version="1.0" encoding="utf-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android" > 

    <solid android:color="#00FFFFFF"/> 

</shape> 

然后将其设置在您的清单中

<activity 
    android:name="MyActivity" 
    android:theme="@style/MyCustomTheme"