问题
I am having a display issue where the mediaController is floating on top of the navigation drawer (see image), when I click the navDrawer while the controller is visible.
I like to display the mediaController below the navDrawer instead.
according to the api, that should be the correct behavior
The way to use this class is to instantiate it programmatically. The MediaController will create a default set of controls and put them in a window floating above your application. Specifically, the controls will float above the view specified with setAnchorView().
I tried the suggestion to set the control using 'setAnchorView' on my videoView and it still displays the controller floating above the navigation drawer. Do note that videoView is displaying the video at the right level (below the navigation drawer).
mediaController.setAnchorView(videoView);
Is there a way to force the mediaController to be below the navigation drawer?
回答1:
addmMediaController.hide();
in overrided ActionBarDrawerToggle's method --> onDrawerSlide
in initialization
mActionBarDrawerToggle = new ActionBarDrawerToggle(this, drawerLayout,"open", "close") {
@Override
public void onDrawerSlide(View mDrawerView, float slideOffset) {
mMediaController.hide();
super.onDrawerSlide(drawerView, slideOffset);
}
};
onDrawerSlide
method fired when Navigation Drawer
opened or closed by button or by your finger
来源:https://stackoverflow.com/questions/37916520/how-to-display-mediacontroller-below-the-navigation-drawer