How to change the font size of tabhost in android

You can define themes, use styles to achieve this: First you create the theme (name:CustomTheme) for your Activity in your res/values/styles.xml: <style name=”CustomTheme” parent=”@android:style/Theme”> <item name=”android:tabWidgetStyle”>@style/CustomTabWidget</item> </style> <style name=”CustomTabWidget” parent=”@android:style/Widget.TabWidget”> <item name=”android:textAppearance”>@style/CustomTabWidgetText</item> </style> <style name=”CustomTabWidgetText” parent=”@android:style/TextAppearance.Widget.TabWidget”> <item name=”android:textSize”>20sp</item> <item name=”android:textStyle”>bold</item> </style> Then in your androidManifest.xml you specify the theme above for your TabActivity or Activity … Read more

Android TabWidget detect click on current tab

After gothrough many solutions for tab listener, I have found very simple solution… getTabHost().setOnTabChangedListener(new OnTabChangeListener() { @Override public void onTabChanged(String tabId) { int i = getTabHost().getCurrentTab(); Log.i(“@@@@@@@@ ANN CLICK TAB NUMBER”, “——” + i); if (i == 0) { Log.i(“@@@@@@@@@@ Inside onClick tab 0”, “onClick tab”); } else if (i ==1) { Log.i(“@@@@@@@@@@ Inside onClick … Read more

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> … Read more

Android: Tabs at the BOTTOM

Here’s the simplest, most robust, and scalable solution to get tabs on the bottom of the screen. In your vertical LinearLayout, put the FrameLayout above the TabWidget Set layout_height to wrap_content on both FrameLayout and TabWidget Set FrameLayout’s android:layout_weight=”1″ Set TabWidget’s android:layout_weight=”0″ (0 is default, but for emphasis, readability, etc) Set TabWidget’s android:layout_marginBottom=”-4dp” (to remove … Read more