Android BottomNavigationView 图标和文本标签在模拟器平板电脑中相互重叠

标签 android kotlin tablet bottomnavigationview

我在 sdp Library 的帮助下创建了布局和 ssp Library , 在 Nexus 10 API 24 模拟器中测试时,BottomNavigationView 显示图标和文本标签相互重叠。它适用于移动屏幕。

底部导航 View :android.support.design.widget.底部导航 View ,

底部导航高度:@dimen/_43sd​​p 相当于移动端的 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>

平板电脑屏幕截图:

Screenshot Tablet Screen

最佳答案

只需增加底部导航 View 的高度。它将覆盖默认高度。让我知道它是否不起作用,因为目前,我已经做到了。

<dimen name="design_bottom_navigation_height" tools:override="true">86dp</dimen>

关于Android BottomNavigationView 图标和文本标签在模拟器平板电脑中相互重叠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58801203/

相关文章:

generics - 针对F <out X>的特定情况F <Nothing>缺少HKT的解决方法

android.intent.action.MY_PACKAGE_REPLACED 不工作

c++ - native C++ 和 Windows 平板电脑

delphi - 为什么屏幕返回的分辨率低于我的 Windows 8 平板电脑设置的分辨率?

java - 约束布局在不同设备上执行不同

安卓 JSONObject : Search function

android - 如何将一个 View 的基线与另一个 View 的顶部对齐

Android Material Design 抽屉导航菜单图标更改

Java - 游戏崩溃、内存不足异常

java - Gradle , Kotlin : How to add another spring boot project as a module dependency in intellij