android - why fragment can't hide bottom bar -
why fragment can't hide bottom bar
but activity can hide top , bottom
use following code :
view decorview = getwindow().getdecorview(); int uioptions = view.system_ui_flag_hide_navigation| view.system_ui_flag_fullscreen; decorview.setsystemuivisibility(uioptions); getactionbar().hide();
fragment side didn't work
i try answer 1 still not work when touch fragment area show top , bottom ,let me confused lot
following code: (fragment side)
@override public void oncreate(bundle savedinstancestate) { view decorview = getactivity().getwindow().getdecorview(); int uioptions = view.system_ui_flag_hide_navigation|view.system_ui_flag_fullscreen; decorview.setsystemuivisibility(uioptions); getactivity().getactionbar().hide(); } @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view rootview = inflater.inflate(r.layout.fragment_ge, container, false); return rootview; }
chuang, try view.system_ui_flag_immersive_sticky
instead of other 2 flags have used. introduced in api 19 per knowledge , require have minimum sdk version same.
Comments
Post a Comment