我正在尝试在ViewPagerIndicator中使用"Sample Styled Tabs"示例,将选项卡文本显示为两行。目前我已经做了以下工作:
In
SampleTabsStyled.java
, I made the following change toGoogleMusicAdapter
. Notice the new line character I added to the title string:@Override public CharSequence getPageTitle(int position) { StringBuilder sb = new StringBuilder(CONTENT[position % CONTENT.length].toUpperCase()); sb.append("\n"); sb.append(RANDOM.nextInt(1000)); return sb.toString(); }
In
styles.xml
, I made the following change:<style name="CustomTabPageIndicator.Text" parent="android:TextAppearance.Medium"> <item name="android:typeface">monospace</item> <item name="android:singleLine">false</item> </style>
然而,在VPI标签中我只看到第一行文字,而没有看到第二行数字。我可能做错了什么?