SimonVT / android-menudrawer

*DEPRECATED* A slide-out menu implementation, which allows users to navigate between views in your app.
http://simonvt.github.com/android-menudrawer/
Apache License 2.0
2.59k stars 1.11k forks source link

Why is my grid not displaying with menudrawer? #190

Closed gustiando closed 11 years ago

gustiando commented 11 years ago

Hi,

I'm trying to have a view with a grid and a bottom menudrawer. However, when I add the menudrawer the grid disappears... is there anything I'm missing/not setting? at first I tried with my own BaseAdapter but I tried to simplify things and even with a very basic grid I still can't have it working when I uncomment out the menudrawer snippet.

here's how I create the grid:

static final String[] numbers = new String[] {
        "A", "B", "C", "D", "E",
        "F", "G", "H", "I", "J",
        "K", "L", "M", "N", "O",
        "P", "Q", "R", "S", "T",
        "U", "V", "W", "X", "Y", "Z"};

ArrayAdapter<String> adapter = new ArrayAdapter<String>(mContext, android.R.layout.simple_list_item_1, numbers);
mMoviesPostersGDV.setAdapter(adapter);

mMenuDrawerTop = MenuDrawer.attach(mActivity, MenuDrawer.Type.OVERLAY, Position.TOP, MenuDrawer.MENU_DRAG_WINDOW);
mMenuDrawerTop.setContentView(R.layout.activity_movies);
mMenuDrawerTop.setMenuView(R.layout.activity_movies_top_menu);

have anyone tried to use a gridview + menudrawer in the same activity? is there any samples? what am I doing wrong?

Thank you!

SimonVT commented 11 years ago

Not sure how you're setting the adapter before you set the content view (where I assume the GridView exists), but you probably shouldn't so that.

gustiando commented 11 years ago

Sorry I didn't quite understand. You mean I should call mMenuDrawerTop.setContentView(R.layout.activity_movies); before mMoviesPostersGDV.setAdapter(adapter); ? do you mind providing a simple example how this would be done?

SimonVT commented 11 years ago

Yes. You wouldn't call mMoviesPostersGDV.setAdapter(adapter); setContentView(R.layout.activity_movies); in a regular Activity either.