3

I've implemented Tabhost from following code, the title seems to be in uppercase by default. How to place a lowercase title in the Tabhost ?

Here's my code for Tabhost implementation.

TabHost tabHost =getTabHost() ;

      // Tab for public
       TabHost.TabSpec publiComp = tabHost.newTabSpec("Public");
       publiComp.setIndicator("Public");
       Intent publicIntent = new Intent(this, CompliancePublic.class);
       publiComp.setContent(publicIntent);

       // Tab for private
       TabHost.TabSpec privateComp = tabHost.newTabSpec("Private");
       privateComp.setIndicator("Private");
       Intent privateIntent = new Intent(this, CompliancePrivate.class);
       privateComp.setContent(privateIntent);

       tabHost.addTab(publiComp);
       tabHost.addTab(privateComp);
Jay Rathod
  • 11,131
  • 6
  • 34
  • 58
Gunners.Ranju
  • 101
  • 3
  • 15

1 Answers1

1

try this

mTabHost = (FragmentTabHost) view.findViewById(android.R.id.tabhost);

mTabHost.setup(getActivity(), getChildFragmentManager(), R.id.realtabcontent);

View tabIndicatorToday = LayoutInflater.from(getActivity()).inflate(R.layout.tab_indicator, mTabHost.getTabWidget(), false);
        ((TextView) tabIndicatorToday.findViewById(R.id.tv_tab_txt)).setText(getResources().getString(R.string.text));

mTabHost.addTab(mTabHost.newTabSpec(getResources().getString(R.string.text)).setIndicator(tabIndicatorToday), Fragment.class, null);

and give your own style to your TextView

Logic
  • 2,230
  • 2
  • 24
  • 41