chevron-up bell reply instagram twitter2 feed3 finder search-25px-p0

Using Tabbed Navigation Bar in Android – A simple tutorial for iOS developers

2017-09-27

The Android does provided a bottom navigation bar natively, however, I found it is a bit difficult to use. After google around, I found a better solution: BottomBar (https://github.com/roughike/BottomBar).

The final look would be like:

Step 0x00: Add dependencies
Add the following dependency to your build.gradle file.

Step 0x01: Add bottom navigation bar layout file

Create a new folder named xml -> right click -> create xml resources -> clean the project:

The file content:

Step 0x02: Create Fragment layouts file and corresponding Java class:

For each of the fragment layout, it would be better to create a seperate layout:

Here, you need to create serveral tabs xml layout resources, such as:

fragment_1.xml
fragment_2.xml
fragment_3.xml

Step 0x03: Add Fragment in the activity_main.xml

In the main layout, load the fragment view:

In the mainActivity, load the tab:

Reference
http://www.arkilis.me/?p=823

arkilis

10 Comments On Using Tabbed Navigation Bar in Android – A simple tutorial for iOS developers

  1. Hello, I enjoy reading all of your post. I wanted to
    write a little comment to support you.

  2. I blog quite often and I genuinely appreciate your content.
    This article has truly peaked my interest. I’m going to bookmark your website and keep checking for new information about once per week.
    I opted in for your Feed as well.

  3. I am genuinely thankful to the holder of this site who has shared this enormous
    post at here.

  4. I’ve been exploring for a little while for excellent articles or blog
    posts on this kind of area. Exploring in Yahoo I at last stumbled upon this website.
    Looking over this info made me discovered just what I wanted.

    I will visit your site frequently.

  5. I love this site very much, It’s truly good to read as well as learn more information.

  6. Howdy! Quick question that’s completely off topic. Do you know how to
    make your site mobile friendly? My website looks weird when viewing from my apple iphone.
    I’m trying to find a theme or plugin that might be able to resolve this issue.
    If you have any suggestions, please share. Many thanks!

    • @Penni Using Boostrap is an easy option.

  7. After looking at a handful of the blog articles on your site, I honestly appreciate your
    way of writing a blog. I added it to my bookmark site list and
    will be checking back in the near future. Please check out my website as well and let me know your
    opinion.

  8. Good post! We will be linking to this great article on our website.
    Keep up the great writing.

  9. Keep on working, great job!

Comments: