Highlight or underline selected TabPageIndicator

前端 未结 2 593
余生分开走
余生分开走 2021-02-13 10:25

I have a dualpane on a tablet-sized landscape layout and I\'m using fragments.

On the left I have a fragment with a listview. When a click occurs on one of the item lis

2条回答
  •  半阙折子戏
    2021-02-13 10:41

    By default the TabPageIndicator doesn't apply any style. To enable the default style from ViewPagerIndicator add the following line to either the application tag or the appropriate activity tag in your manifest.xml

    android:theme="@style/Theme.MyTheme"
    

    Then add a res\values\styles.xml file to your project with the following content

    
    
          
      
    

    I'm using the android light theme for my application, but you might want to change this to the theme you are using now.

    If you want to make changes to the default VPI style change the styles.xml file to something like this:

    
    
    
        
    
      
    
      
    
    
    

    Note that the settings above are exactly the same as the default VPI style for the TabPageIndicactor, so you still have to make the changes you'd like.

提交回复
热议问题