download an element from the listView as footer


I want to download the close session below everything like the image but I can not do it, I'm left below the last item in the menu

add this line to add a footer to the listview but leave it below the next element but not below as I want it.

View footerView = ((LayoutInflater) this.getSystemService(this.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.footer, null, false);

in the side menu is a listview and each item is a menu item.

asked by jonatan diaz 23.05.2018 в 18:35

1 answer


Actually if you add an item to the list using the addFooterView ( ) , this will add the element to the end of the list.


addFooterView () : Add a fixed view to appear in the part   bottom of the list.


But it is important to ensure that you are really adding the view to ListView , listViewSliding must be the ListView that contains the other elements of NavigationDrawer .

answered by 24.05.2018 / 01:33