-
Notifications
You must be signed in to change notification settings - Fork 27
Menu: Header & Footer
三木思 edited this page Nov 6, 2018
·
2 revisions

You can see the picture above, the border above of the picture is the header view, and the border below of the picture is the footer view.
You can refer to 'Header & Footer' in the demo.
There are tow methods to attach a header view to the menu, you can use it by calling in TimoMenu or TimoMenu.Builder:
| Method | Description |
|---|---|
| setHeaderView(View headerView) | Specify a view directly |
| setHeaderLayoutRes(int headerLayoutRes) | Specify a layout resource id directly |
There are tow methods to attach a footer view to the menu, you can use it by calling in TimoMenu or TimoMenu.Builder:
| Method | Description |
|---|---|
| setFooterView(View headerView) | Specify a view directly |
| setFooterLayoutRes(int headerLayoutRes) | Specify a layout resource id directly |
If you directly specify a view without layoutparams, it may cause the header view and footer view width and height properties to be invalid.
When you need to pass a header view or a footer view, you'd better specify a viewgroup when you create it like the following:
View footer = getLayoutInflater().inflate(R.layout.layout_footer, mTimoMenu.getMenuView(), false);English
Menu
Item
中文
Menu
Item