简体   繁体   中英

Fixed header and footer in android app

I want to use fixed header and footer in my android app, but every time a new activity starts, the page refreshes and both the header and footer reload.
How can I make them fixed through out the application life cycle so that they never reload, although I can hide, remove and add items to them?

I've used the include tag and it's not what I want

You may use one Activity with header, footer and the content Fragment. Instead of starting new Activity, you'll change the content Fragment.

But. This is not expected neither by Android nor by user. Also you need some kind of Back button handling, state saving/restoring and so on. Are you sure that you want to do what you described?

If so, here are some useful links:

Also if you want to use fragments on Android prior 3.0 (API level 11), you'll need the Support Library For custom transit animation

这是给您的示例示例,如何在整个应用程序中具有固定的页眉和页脚

你可以考虑这个例子

You can use Include tag which can include layout which you want . in every layout of your app just add Include tag as header and footer of your layout

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM