【发布时间】:2019-11-11 12:18:58
【问题描述】:
我在 sdp Library 和 ssp Library 的帮助下创建了布局,在 Nexus 10 API 24 模拟器中进行测试时,BottomNavigationView 显示相互重叠的图标和文本标签。它可以在手机屏幕上正常使用。
BottomNavigationView : android.support.design.widget.BottomNavigationView,
底部导航高度:@dimen/_43sdp 相当于移动端的 56dp,
底部导航图标大小:@dimen/_18sdp,
底部导航文本标签大小:@dimen/_12ssp,
我无法理解出了什么问题。请指导我。
布局代码:
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/cord_home_root"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.mainHome.MainNavigationActivity">
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<android.support.design.widget.BottomNavigationView
android:id="@+id/bottom_navigation_view"
style="@style/BottomNavigation"
android:layout_width="match_parent"
android:layout_height="@dimen/bottom_navigation_height"
android:layout_gravity="bottom"
android:background="@color/white"
app:itemIconSize="@dimen/bottom_navigation_icon_size"
app:elevation="@dimen/_6sdp"
app:labelVisibilityMode="labeled"/>
<!--app:layout_behavior="@string/hide_bottom_view_on_scroll_behavior"-->
</android.support.design.widget.CoordinatorLayout>
平板电脑屏幕截图:
【问题讨论】:
-
发布您的布局
-
添加了布局。 @GabrieleMarriotti
-
在BottomNavigationView中使用android:layout_height="wrap_content"
-
试过了,没用
标签: android kotlin tablet bottomnavigationview