Android remove space between tabs in tabwidget?

For removing the grey line at the bottom of your tabbar, you can set tabHost.getTabWidget(). SetStripEnabled(false) As of removing the gap between the tabs.. The best way would be to use your own drawable without any paddings. You can use images for this, or you can create your tabs' backgrounds via xml's, say inside a layer_list root element: layer_list> .. ..

For removing the grey line at the bottom of your tabbar, you can set tabHost.getTabWidget(). SetStripEnabled(false); As of removing the gap between the tabs.. The best way would be to use your own drawable without any paddings. You can use images for this, or you can create your tabs' backgrounds via xml's, say inside a root element: .. .. and set this drawable to be the background of your TabWidget.To see how to customize your tabs, there are a lot of tutorials on the web.

For example this one by Josh is short and has a nice explanation. Update Here I share a small sample of tabwidget using custom tabs (based on your code) to achieve the following output: What you need: three new layer drawables (for selected, focused and unselected states of the tabs) two state drawables (for the text and background of the different states) a new layout for the tabs update your main. Xml update your activity class update your androidManifest.

Xml (remove the style declarations) The three layer drawables: tab_normal. Xml, tab_focused. Xml, tab_selected.

Xml drawable/tab_normal. Xml: drawable/tab_focused. Xml: drawable/tab_selected.

Xml: The two state drawables: tab_background_selector. Xml, tab_text_selector. Xml drawable/tab_background_selector.

Xml: drawable/tab_text_selector. Xml: The new layout for the tabs: tab. Xml layout/tab.

Xml main. Xml: InfralineTabWidget. Java: public class InfralineTabWidget extends TabActivity { public void onCreate(Bundle savedInstanceState) { super.

OnCreate(savedInstanceState); setContentView(R.layout. Main); final TabHost tabHost = (TabHost) getTabHost(); tabHost. AddTab(createTab(TopNewsActivity.

Class, "topNews", "Top News", R.drawable. Tab_news)); tabHost. AddTab(createTab(PowerActivity.

Class, "power", "Power", R.drawable. Tab_power)); tabHost. AddTab(createTab(EnergyActivity.

Class, "energy", "Renewable Energy", R.drawable. Tab_energy)); tabHost. AddTab(createTab(CoalActivity.

Class, "coal", "Coal", R.drawable. Tab_coal)); tabHost. AddTab(createTab(OilnGasActivity.

Class, "oilnGas", "Oil & Gas", R.drawable. Tab_oilngas)); tabHost. SetCurrentTab(0); tabHost.getTabWidget().

GetChildAt(0).getLayoutParams(). Width = 140; tabHost.getTabWidget(). GetChildAt(1).getLayoutParams().

Width = 140; tabHost.getTabWidget(). GetChildAt(2).getLayoutParams(). Width = 140; tabHost.getTabWidget().

GetChildAt(3).getLayoutParams(). Width = 140; tabHost.getTabWidget(). GetChildAt(4).getLayoutParams().

Width = 140; } private TabSpec createTab(final Class intentClass, final String tag, final String title, final int drawable) { final Intent intent = new Intent(). SetClass(this, intentClass); final View tab = LayoutInflater. From(getTabHost().getContext()).

Inflate(R.layout. Tab, null); ((TextView)tab. FindViewById(R.id.

Tab_text)). SetText(title); ((ImageView)tab. FindViewById(R.id.

Tab_icon)). SetImageResource(drawable); return getTabHost(). NewTabSpec(tag).

SetIndicator(tab). SetContent(intent); } } And this is it.To create straight cornered tabs, just lose the corner specifications from the layer drawable xml files. Also play around the colors, strokes, etc. , to make the outcome fit your preferences.

I didn't got it can you please elaborate – ReNa Apr 27 at 14:27 2 please see my update for a working sample of custom tabs. Play with the 'borders', strokes, colors, corners, to get them look as you like. – rekaszeru Apr 27 at 18:11 1 It seems ridiculous to have to go through all of this to simply change the background drawable of the tabs based on the state... great code though – jondavidjohn Jun 29 at 14:43.

This link should help you ondrejcermak.info/programovani/custom-ta....

Accept answers if you feel they are right! :) – Jana Apr 27 at 6:39.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions