Custom font for ActionBarSherlock tabs

后端 未结 6 2022
滥情空心
滥情空心 2020-12-16 02:13

I want to set font for the \"Video\" and \"Image\" tabs in ActionBarSherlock. I have used the following code to do so. Its showing accurately in ICS but not in

6条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-16 02:38

    Okay . I found it myself some where on SO.

    First make an xml file with this in it: tab_title.xml

    
    

    Then in the class where you in instantiate your ActionBar use this code to set the text on each of the tabs. (This example is using ActionBarSherlock.)

    ActionBar bar = getSupportActionBar();
    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    
    String[] tabNames = {"Tab 1","Tab 2","Tab 3"};
    
    for(int i = 0; i

提交回复
热议问题