Android Can';t使粗糙的底部栏导航标题居中
在我的android项目中,我正在使用roughike实现底部栏导航。我没有使用任何图标图像,因为我觉得使用图像和保持分辨率比使用图标更复杂。因此,我以这种方式编写代码:Android Can';t使粗糙的底部栏导航标题居中,android,xml,font-awesome,bottomnavigationview,android-bottomnav,Android,Xml,Font Awesome,Bottomnavigationview,Android Bottomnav,在我的android项目中,我正在使用roughike实现底部栏导航。我没有使用任何图标图像,因为我觉得使用图像和保持分辨率比使用图标更复杂。因此,我以这种方式编写代码: <com.roughike.bottombar.BottomBar android:id="@+id/menu_bottomBar" android:layout_width="match_parent" android:layout_height="60dp" app:bb_titleT
<com.roughike.bottombar.BottomBar
android:id="@+id/menu_bottomBar"
android:layout_width="match_parent"
android:layout_height="60dp"
app:bb_titleTypeFace="fonts/fontawesome.ttf"
android:layout_alignParentBottom="true"
app:bb_tabXmlResource="@xml/bottombar_tabs" />
导航功能按预期正常工作,但所有选项卡标题显示在导航顶部。如何使其垂直居中?我试着使用重力,但没有任何效果。
感谢你的帮助,谢谢,
罗宾
您可以尝试更改容器
重力
(容器是主机选项卡视图的对象,如图像视图
,文本视图
等)
for(int i=0;i
<tabs>
<tab
id="@+id/tab_home"
title="\uf278" />
<tab
id="@+id/tab_chat"
title="\uf0e6" />
<tab
id="@+id/tab_globe"
title="\uf0ac" />
<tab
id="@+id/tab_friends"
title="\uf0c0" />
<tab
id="@+id/tab_profile"
title="\uf2be" />
</tabs>
for (int i = 0; i < mBottomBar.getTabCount(); i++) {
mBottomBar.getTabAtPosition(i).setGravity(Gravity.CENTER_VERTICAL);
}