Android remove spaces between tabs in tabwidget

I have made an application which have these tabs.I want to show tabs in my application but by default in android like this.

But i want to show tabs like this

So i want to remove the divider line and space between two tabs and also by default the tabs background color is gray color. so i want to change this into White color.

Please tell how to remove divider line and space between two tabs and change the background color of tabs.

I am follow this link to make the tabwidget http://www.mkyong.com/android/android-tablayout-example/

Answers


try

mTabHost.getTabWidget().setStripEnabled(false);

to remove strip in tabhost an

mTabHost.getTabWidget().setDividerDrawable(null); 

remove diver line, and use customview to change background color.


You will have to take advantage of the following on the TabWidget:

setDividerDrawable(null); //Or provide your own divider here as needed

as well as modifying the background drawable for the Tabs.

If you decide not to do this programmatically, then Override the class and create your own version of the tab that you would like to reference instead of the default class and put those into your XML layout file instead.


Here is a simple solution:

<android.support.design.widget.TabLayout
app:tabPaddingStart="0dp"
app:tabPaddingEnd="0dp" />

Since the tab structure uses drawables to display the graphics you see, you can simply replace them with custom graphics. In your case, with transparent, or white ones (depending on what you want to do with them)

Implementing a custom style for the tab would be the best way to do it. I'd start with these elements:

<item name="android:divider">@drawable/MY_DIVIDER</item>
<item name="android:background">@drawable/MY_TAB_BACKGROUND</item>
<item name="android:dividerPadding">0 dp</item>

Need Your Help

OpenSSL: HTTPS proxy

c++ ssl proxy openssl

So far, my proxy only deals HTTP connections on port 80: I'd like to improve it and make it manage HTTPS requests. Here's how it works:

Stacking with position: relative

html css

I'm attempting to stack divs (styled to look like sticky-notes) so that part of the divs on the bottom hang out. I initially considered okay, I'll just style the top-most div as normally, and then ...