本文介绍了在行动吧箭福尔摩斯不显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目,我已经用行动吧福尔摩斯库。我想打在行动栏按钮我用下面的code

In my project I have used action bar sherlock library. I want to make back button in action bar I used following code

getSupportActionBar().setHomeButtonEnabled(true);

@Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {

        case android.R.id.home:
             finish();
             break;

        default:
            return super.onOptionsItemSelected(item);
        }
        return false;
    }

每一件事情是工作的罚款,但后退箭头(以图标的左侧)不显示。我想告诉后退箭头也。谁能告诉我什么,我做错了。

Every thing is working fine, but back Arrow (to the left of icon) is not displaying. I want to show Back Arrow also. Can anyone tell me what I am doing wrong.

推荐答案

您必须设置它是这样的:

You have to set it up this way:

ActionBar ab = getSupportActionBar();
ab.setDisplayHomeAsUpEnabled(true);

希望有所帮助。

Hope that helps.

这篇关于在行动吧箭福尔摩斯不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 09:16