My code below locks the drawerlayout when using a tablet (in landscape mode)
if(condition)
{
//Landscape mode
mDrawerLayout.SetDrawerLockMode(DrawerLayout.LockModeLockedOpen);
mDrawerLayout.SetScrimColor(Color.Transparent);
}
else
{
//Portrait mode
mDrawerLayout.SetDrawerLockMode(DrawerLayout.LockModeUnlocked);
mDrawerLayout.SetScrimColor(Color.LightGray);
}
However, if I open it up in landscape it locks the drawerlayout as expected, however when changing it to portrait mode I cannot swipe it away. It does the opposite when opening it up in portrait (allows me to open and close) but then changing to landscape it opens it but doesn't lock it in so the user can swipe it away and break the view.
Not to sure what I am missing, as I have stepped through the code countless times and it follows the right paths.
I had the same issue and moving that code to my onResume() did the trick.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With