0

I'm trying to set a 1px divider between my (android) action bar and split tabs below. how can it be done?

Thanks,

mmBs
  • 7,728
  • 6
  • 37
  • 43
Sharas
  • 957
  • 1
  • 11
  • 30

1 Answers1

0

Just put this view between the actionBar and splitTabs

Vertical:

<View
    android:layout_width="fill_parent"
    android:layout_height="1dp"
    android:background="@android:color/darker_gray"/>

Horizontal:

<View
    android:layout_width="1dp"
    android:layout_height="fill_parent"
    android:background="@android:color/darker_gray"/>

Android Drawing Separator/Divider Line in Layout?

You could do this dynamically the same way as above just in java:

View div = new View(this);
div.setBackgroundColor(0xaaaaaa);
div.setLayoutParams(new ViewGroup.LayoutParams(1,-1));

I never tested the code but it would be something similar.

Community
  • 1
  • 1
Nicolas Tyler
  • 9,372
  • 4
  • 38
  • 62
  • Thanks for your reply. I'm not sure i can do it, since i'm creating the tabs dynamically mActionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); mDayTab = mActionBar.newTab(); mDayTab.setText(getString(R.string.day_view)); mDayTab.setTabListener(this); mActionBar.addTab(mDayTab); – Sharas Jul 10 '13 at 06:49
  • @Gidi did you get the answer? i want also answer. can you help me – Manikandan Jul 23 '14 at 06:28
  • and there is a horizontal divider line (white in my case) below tab bar. I want to remove that divider line. Any idea? – Adnan Feb 12 '15 at 16:38