更新时间:2026/11/12 10:48
导航SDK还开放了导航中部分按钮和界面的显示隐藏功能。详细的设置项可参考类参考文档IBNProfessionalNaviSetting,部分示例如下:

实现方法:
代码
Bundle params = new Bundle();params.putBoolean(BNaviCommonParams.ProGuideKey.IS_SUPPORT_FULL_SCREEN, true);BNGuideConfig config = new BNGuideConfig.Builder() // 导航工具栏上方view .addAboveBottomView(new IBNRouteGuideManager.NaviAddViewCallback() { @Override public int getViewHeight() { return 100; } @Override public View getAddedView() { TextView textView = new TextView(BNDemoCustomGuideActivity.this); textView.setBackgroundColor(Color.parseColor("#ffff00")); textView.setText("导航工具栏上方自定义空间"); textView.setGravity(Gravity.CENTER); textView.setTextColor(Color.parseColor("#000000")); FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, 100); textView.setLayoutParams(lp); return textView; } }) // 导航工具栏view .addBottomBarView(new IBNRouteGuideManager.NaviAddViewCallback() { @Override public View getAddedView() { TextView textView = new TextView(BNDemoCustomGuideActivity.this); textView.setBackgroundColor(Color.parseColor("#ff00ff")); textView.setText("导航工具栏自定义空间"); textView.setGravity(Gravity.CENTER); textView.setTextColor(Color.parseColor("#000000")); FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); textView.setLayoutParams(lp); return textView; } }) // 导航工具栏下方view .addBelowBottomView(new IBNRouteGuideManager.NaviAddViewCallback() { @Override public int getViewHeight() { return 100; }
@Override public View getAddedView() { TextView textView = new TextView(BNDemoCustomGuideActivity.this); textView.setBackgroundColor(Color.parseColor("#00ffff")); textView.setText("导航工具栏下方自定义空间"); textView.setGravity(Gravity.CENTER); textView.setTextColor(Color.parseColor("#000000")); FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, 100); textView.setLayoutParams(lp); return textView; } }) .params(params) .build();BaiduNaviManagerFactory.getRouteGuideManager().onCreate(getActivity(), config);本篇文章对您是否有帮助?