11

enter image description hereIn Android 4.0 i put tab bar with two widget. in code i write in small alphabates(new) but in application it should always display (NEW) How to write small alphabates on tab in android 4.0

TZHX
  • 5,291
  • 15
  • 47
  • 56
user1153176
  • 1,006
  • 5
  • 15
  • 21

2 Answers2

20

Theres no need to create custom theme

In source code..

   TextView tv =  (TextView) mTabHost.getTabWidget().getChildAt(index).findViewById(android.R.id.title); 
   tv.setAllCaps(false);  
Taryn
  • 242,637
  • 56
  • 362
  • 405
YuseonHan
  • 201
  • 2
  • 2
  • 1
    setAllCaps() is not available in android 2.x, this solution will not work there. – Manohar Dec 14 '12 at 14:10
  • 2
    @Manohar Well, TABS are not available in android 2.x so this entire question is relevant only for Android 3+. In case you are using ActionBarSherlock or ActionBarCompat library the similar approach is applied there. – Alex Semeniuk Jun 27 '14 at 09:25
12

The default theme for tab views in Android 4.0 (the Holo theme) has android:textAllCaps set to true. You can create your own theme and then apply it to the action bar in your manifest to override this behavior. For more information on styling the ActionBar and creating your own styles, see:

http://developer.android.com/guide/topics/ui/themes.html and http://android-developers.blogspot.com/2011/04/customizing-action-bar.html

Jason LeBrun
  • 13,037
  • 3
  • 46
  • 42