c# - How to hide Windows Phone 8.1 StatusBar in only landscape orientation? -
i'm using code hide command bar landscape mode couldn't hide status bar . need hide watching full , clean screen youtube videos in app .
void current_sizechanged(object sender, windows.ui.core.windowsizechangedeventargs e) { string currentviewstate = applicationview.getforcurrentview().orientation.tostring(); if (currentviewstate == "portrait") bottombar.visibility = visibility.visible; if (currentviewstate == "landscape") bottombar.visibility = visibility.collapsed; }
i have found solution. here codes.
void current_sizechanged(object sender, windows.ui.core.windowsizechangedeventargs e) { // new view state string currentviewstate = applicationview.getforcurrentview().orientation.tostring(); var statusbar = windows.ui.viewmanagement.statusbar.getforcurrentview(); if (currentviewstate == "portrait") { bottombar.visibility = visibility.visible; showstatusbar(); } if (currentviewstate == "landscape") { bottombar.visibility = visibility.collapsed; hidestatusbar(); } } private async void showstatusbar() { var statusbar = statusbar.getforcurrentview(); await statusbar.showasync(); } private async void hidestatusbar() { var statusbar = statusbar.getforcurrentview(); await statusbar.hideasync(); }
Comments
Post a Comment