O
O
Olzhas Ilyubayev2015-11-16 21:26:26
Android
Olzhas Ilyubayev, 2015-11-16 21:26:26

How to make Navigation Drawer full screen width?

Interested in the possibility of creating Drawer'a in the entire width of the screen.
1) You can programmatically specify the width based on the screen size, but something tells me that this is the wrong solution to the problem. + what to do when changing the screen orientation?
2) Use a regular fragment as a navigation window, which will be called on a button click. But how to fasten gestures?
3) Specifying match_parent for NavigatiovView width or other layout doesn't help. As I understand it, padding or margin is specified in the drawerlayout itself.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xotta6bl4, 2015-11-26
@xotta6bl4

((DrawerLayout.LayoutParams) root.getLayoutParams()).width = root.getContext().getResources().getDisplayMetrics().widthPixels;

Where root is the menu container. Call at startup and when the screen size changes (for example, change of orientation)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question