简体   繁体   English

如何在我的Android应用程序的导航栏中添加按钮?

[英]How to add a button in the navigation bar in my android application?

In my application (only for my application), I want to add a button to the navigation system bar 在我的应用程序中(仅适用于我的应用程序),我想向导航系统栏添加一个按钮

在此处输入图片说明

How I can do that in my code? 如何在我的代码中做到这一点?

You cannot do anything there. 你在那里什么也不能做。 Not to mention some devices will not show this bar at all if they got hardware buttons. 更不用说有些设备如果有硬件按钮,则根本不会显示该栏。

You can't. 你不能

Maybe try to add a fragment that will be exactly above it. 也许尝试添加一个恰好位于其上方的片段。

Some phones don't even have that buttons on screen. 有些手机甚至在屏幕上都没有该按钮。

首先检查手机或选项卡上是否有软按钮,然后通过编程使全屏显示,然后在底部创建像标签栏一样的自定义按钮栏,然后按自己喜欢的方式放置按钮,如果您没有其他想法的话

getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM