导航sdk还开放了导航中部分按钮和界面的显示隐藏功能。详细的设置项可参考类参考文档ibnprofessionalnavisetting,部分示例如下:
实现方法:
bundle params =newbundle();params.putboolean(bnavicommonparams.proguidekey.is_support_full_screen,true);bnguideconfig config =newbnguideconfig.builder()// 导航工具栏上方view.addabovebottomview(newibnrouteguidemanager.naviaddviewcallback(){@overridepublic int getviewheight(){return100;}@overridepublicviewgetaddedview(){textview textview =newtextview(bndemocustomguideactivity.this);textview.setbackgroundcolor(color.parsecolor("#ffff00"));textview.settext("导航工具栏上方自定义空间");textview.setgravity(gravity.center);textview.settextcolor(color.parsecolor("#000000"));framelayout.layoutparams lp =newframelayout.layoutparams(viewgroup.layoutparams.match_parent,100);textview.setlayoutparams(lp);return textview;}})// 导航工具栏view.addbottombarview(newibnrouteguidemanager.naviaddviewcallback(){@overridepublicviewgetaddedview(){textview textview =newtextview(bndemocustomguideactivity.this);textview.setbackgroundcolor(color.parsecolor("#ff00ff"));textview.settext("导航工具栏自定义空间");textview.setgravity(gravity.center);textview.settextcolor(color.parsecolor("#000000"));framelayout.layoutparams lp =newframelayout.layoutparams(viewgroup.layoutparams.match_parent,viewgroup.layoutparams.match_parent);textview.setlayoutparams(lp);return textview;}})// 导航工具栏下方view.addbelowbottomview(newibnrouteguidemanager.naviaddviewcallback(){@overridepublic int getviewheight(){return100;}@overridepublicviewgetaddedview(){textview textview =newtextview(bndemocustomguideactivity.this);textview.setbackgroundcolor(color.parsecolor("#00ffff"));textview.settext("导航工具栏下方自定义空间");textview.setgravity(gravity.center);textview.settextcolor(color.parsecolor("#000000"));framelayout.layoutparams lp =newframelayout.layoutparams(viewgroup.layoutparams.match_parent,100);textview.setlayoutparams(lp);return textview;}}).params(params).build();baidunavimanagerfactory.getrouteguidemanager().oncreate(getactivity(), config);
上一篇
下一篇
本篇文章对您是否有帮助?