首页 > 解决方案 > After updating implementation 'com.android.support:design:28.0.0' this item.setShiftingMode(false); has been removed

问题描述

after updating 28.0.0 i removed item.setShiftingMode(false); then i added this app:labelVisibilityMode="labeled" to xml.

But icon showing correct but label is cut off long text showing only half

example enter image description here

performance cut off please give me suggestion thank you for your advance.

标签: androidandroid-studio

解决方案


嗨,伙计们,我找到了更改文本大小的解决方案,但它的工作我不确定这是正确的方法。我的问题已经解决的任何方式现在都按照我的示例进行操作。添加您的 style.xml 文件这些行:

 <style name="BottomNavigationView">
    <item name="itemTextAppearanceActive">@style/TextAppearance.BottomNavigationView.Active</item>
    <item name="itemTextAppearanceInactive">@style/TextAppearance.BottomNavigationView.Inactive</item>
</style>
<style name="TextAppearance"/>
<style name="TextAppearance.BottomNavigationView"/>
<style name="TextAppearance.BottomNavigationView.Inactive">
    <item name="android:textSize">12sp</item>
</style>
<style name="TextAppearance.BottomNavigationView.Active">
    <item name="android:textSize">11sp</item>
</style>

然后将此行添加到您的底部导航视图:

style="@style/BottomNavigationView"

这就是它的工作原理 在此处输入图像描述


推荐阅读