Skip to content

Instantly share code, notes, and snippets.

@vekexasia
Created August 28, 2015 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vekexasia/33fa5a66c6c10fd5b042 to your computer and use it in GitHub Desktop.
Save vekexasia/33fa5a66c6c10fd5b042 to your computer and use it in GitHub Desktop.
Footer adding to NavigationView
class MyFragment extends Fragment {
/* ... */
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
ListView listView = (ListView) navigationView.getChildAt(0);
View toRet = LayoutInflater.from(view.getContext()).inflate(R.layout.drawer_footer, listView, false);
// Manipulate the view (if you need to) before calling addFooterView.
listView.addFooterView(toRet, null, false);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment