如何在Android的v7工具栏中删除“后退"按钮? [英] How do you remove the back button from a v7 toolbar on Android?

查看:50
本文介绍了如何在Android的v7工具栏中删除“后退"按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从Android的v7工具栏中删除后退按钮?

How do you remove the back button from a v7 toolbar on Android?

我在下图中突出显示了要删除的按钮:

I highlighted the button that I'm trying to remove in the image below:

推荐答案

如果您使用的是v7工具栏,则可以使用以下代码删除此按钮:

If you are using v7 Toolbar you can remove this button with this code :

if (getSupportActionBar() != null) {
    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayHomeAsUpEnabled(false);
}

您可以在此处阅读此处了解更多信息.也这个问题可能有帮助

you can read android here and here for more information. also this question may help

这篇关于如何在Android的v7工具栏中删除“后退"按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆