How to use slide menu function when content view is not active yet?

72 Views Asked by At

enter image description here

I have the content view which contains list view in. When I set list view with width, height is match parent, then slide function does not work.

layout_width="match_parent" , layout_height="match_parent"

In this case, slide function not work. Any help would be appreciated.

1

There are 1 best solutions below

1
Robert Wm Ruedisueli On

While you need "content" in the page for it to be considered to be an existing content, the content can be blank.

To be clear the content needs to be blank. If it currently is "null" (i.e. non-existant) you need to replace it with a blank page. (i.e. a solid white box.)

The fact that the page will even load at all with the null content is a surprise. It's a situation that shouldn't be done, and will cause Null Reference Exceptions on some other platforms.

You should never load anything with nothing in it. Always declare something as a blank template of some form, not null or void unless it is meant to be null or void. It's just good programming practice to always declare your objects and regions as the base type they will be used in. So in this case, a blank material region.