全部服务产品
开发者频道
定价
登录
自定义UI控件
下载开发文档

导航sdk还开放了导航中部分按钮和界面的显示隐藏功能。详细的设置项可参考类参考文档IBNProfessionalNaviSetting,部分示例如下:

androidstudio_2.png

实现方法:

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);

上一篇

自定义标注

下一篇

其他自定义能力

本篇文章对您是否有帮助?