【发布时间】:2018-03-30 19:29:42
【问题描述】:
我需要创建自定义选项卡布局,但我希望文本模仿普通TabLayout.TabView 中使用的样式。
为此,我将文本外观设置为TextAppearance.Design.Tab。
如果你看一下TabLayout 本身,你会发现TabView 的文字使用的是这样的:
mTabTextAppearance = a.getResourceId(R.styleable.TabLayout_tabTextAppearance, R.style.TextAppearance_Design_Tab);
...
TextViewCompat.setTextAppearance(mTextView, mTabTextAppearance);
但是,当我的标签显示时,我可以清楚地看到不一样的文字。它非常相似,但默认选项卡看起来更粗。
我做错了什么?
【问题讨论】: