rags
rags

Reputation: 21

Android creating Bottom Bar Menu

I want to have an static bottom menu bar exist through out the applications in every page visible at bottom all the time. I have designed the menu bar but i am confused whether i have to integrate the menu code with every layout xmls to make menu visible in every page and write the code in every activity class to perform functions on menu clicks. Or if there is any other way i can create a common bottom bar that lies with every page with writing the code of menu in a single activity class.

Upvotes: 2

Views: 19640

Answers (3)

dave.c
dave.c

Reputation: 10908

There is also the include route:

Upvotes: 1

Muhammad Shahab
Muhammad Shahab

Reputation: 4270

Well the best way in my opinion , is to create a bottom bar xml file , and include it in every Activity's xml file

<include android:layout_width="fill_parent" layout="@layout/bottom_bar" />

where your bottom bar xml file name is bottom_bar.xml

This article also might help you

http://android-developers.blogspot.com/2009/02/android-layout-tricks-2-reusing-layouts.html

Upvotes: 7

Peter Knego
Peter Knego

Reputation: 80330

What you are probably looking for is one Activity with a TabBar with tabs at the top and buttons at the bottom: Android: Tabs at the BOTTOM

Then you can use different Views that correspond to Tabs instead of separate Activities.

Upvotes: 0

Related Questions