0

I want to display the bottom tab bar as MAC system dock menu

enter image description here

How to achieve this dock menu in android

Kalai
  • 459
  • 2
  • 7
  • 20

2 Answers2

2

TabHost not provide to much facility to customize there layout. So what i did, I create a layout as I wanted with combination of ImageView and transfer it's click to relative TabWidget. I created layout like below.

<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <FrameLayout
        android:id="@android:id/tabcontent"
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="1"/>

    <FrameLayout 
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="fill_horizontal">

        <include 
            android:id="@+id/customtab"
            layout="@layout/customtablayout"/>
      <TabWidget
        android:id="@android:id/tabs"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:visibility="invisible"
        android:layout_weight="0" />

      </FrameLayout>
</LinearLayout>

Here customtablayout is my layout with images as tab(you can add anithing). and when I click to a image, I called tabHost.setCurrentTab(index);.

maddy d
  • 1,434
  • 1
  • 12
  • 22
1
  1. You can check (tab whith image) : How to change the Tabs Images in the TabHost

  2. You applay mirror effect to your image

  3. Set Animation for resizing the view Resizing layouts programmatically (as animation)

Community
  • 1
  • 1