0

I want to increase text size on my tabs which used default android swipe tab

here's the code I'm using to set the tabs

    public class MainActivity extends FragmentActivity implements
ActionBar.TabListener {

    private String[] tabs = { "Recent News", "All News" };
    private TabsPagerAdapter mAdapter;
    private ViewPager viewPager;
    ActionBar.Tab tab;
    private AdView mAdView;
    private ActionBar bar;
    public static final String PREFS_NAME = "MyPrefsFile1";
    public CheckBox dontShowAgain;
    @Override
    public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        viewPager = (ViewPager) findViewById(R.id.pager);
        getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);

        bar = getActionBar();
        bar.setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.header)));
        bar.setStackedBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.header)));
        getActionBar().setIcon(new ColorDrawable(getResources().getColor(android.R.color.transparent))); 

        mAdapter = new TabsPagerAdapter(getSupportFragmentManager());
        viewPager.setAdapter(mAdapter);

        //tab added in action bar
         for(String tab_name:tabs)
         {

            tab = getActionBar().newTab();
            tab.setText(tab_name);
            tab.setTabListener(this);
            getActionBar().addTab(tab);
         }
IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198
Mohammad Hammad
  • 105
  • 1
  • 2
  • 8
  • You have to do it programmatically. Check Here--> http://stackoverflow.com/questions/5788971/how-to-change-the-font-size-of-tabhost-in-android http://stackoverflow.com/questions/12624175/change-text-size-on-tabhost – Chaudhary Amar Oct 26 '15 at 09:43

1 Answers1

0

Add this code may be its helps you

 TextView txt1= (TextView) tabHost.getTabWidget().getChildAt(0).findViewById(android.R.id.TextView1);
 txt1.setTextSize(25);
Android
  • 535
  • 5
  • 16