How to change orientation of Android SlidingDrawer

2019-04-01 18:38发布

I cant find a way to set the orientation on my SlidingDrawer when i change from landscape mode to portrait mode visa versa.

Initially i set the orientation by xml to vertical. I need to change the orientation to horizontal when the phone is in landscape mode, so i get the handle on the left.

Any ideas anybody?

2条回答
男人必须洒脱
2楼-- · 2019-04-01 19:07

Isn't it as simple as putting one main.xml in the layouts for landscape mode (layout-land) and the other in the layouts for portrait mode (layout-port). Or am I missing something?

查看更多
聊天终结者
3楼-- · 2019-04-01 19:34

I do not believe that is possible with the standard SlidingDrawer. You may be able to implement your own drawer (perhaps a subclass of SlidingDrawer) that implements this functionality.

SlidingDrawer appears to be limited, in large part, to what is needed for the application drawer in the standard Android home screen. That drawer always stays anchored to the same physical side of the screen (bottom if portrait, right if landscape).

查看更多
登录 后发表回答