E
E
Edward2014-01-10 23:21:33
Android
Edward, 2014-01-10 23:21:33

Why is the NavigationDrawer not showing full height?

Have an Activity with a Navigation Drawer

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/dl_main"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<FrameLayout
android:id="@+id/fl_for_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ListView
android:id="@+id/lv_navigation_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="@color/gray" />
</android.support.v4.widget.DrawerLayout>

public class MainActivity extends ActionBarActivity implements OnItemClickListener {

private DrawerLayout dl_main;
private ActionBarDrawerToggle ab_drawer_toggle;
ListView lv_navigation_drawer;

protected void onCreate(Bundle savedInstanceState) {
<b>...</b>
lv_navigation_drawer = (ListView) findViewById(R.id.lv_navigation_drawer);
lv_navigation_drawer.setSelector(R.color.white__light_gray_clicable);
lv_navigation_drawer.setAdapter(new NavigationListAdapter(this));
lv_navigation_drawer.setOnItemClickListener(this);

dl_main = (DrawerLayout) findViewById(R.id.dl_main);
ab_drawer_toggle = new ActionBarDrawerToggle(this, dl_main, R.drawable.navigation_drawer, R.string.app_name, R.string.app_name ) {

public void onDrawerClosed(View view) {
getSupportActionBar().setTitle("title");
}

public void onDrawerOpened(View drawerView) {
getSupportActionBar().setTitle(getTitle());
}
};
dl_main.setDrawerListener(ab_drawer_toggle);

but when you pull out the Navigation Drawer, the ListView has a height not for the whole screen, but for the number of elements (content is visible between it and the bottom of the screen). Given that before this fucking ListView had a height of the entire screen ... What to do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
itspers, 2014-01-11
@ED98

It has a normal height, it's just transparent by default. Give it a background.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question