android - 底栏未在底部对齐

标签 android xml android-coordinatorlayout

我想使用 com.roughike.bottombar.BottomBar 但即使在底部设置重力后,它也会隐藏在操作栏后面。请解决我的错误。 谢谢。

activity_main.xml

<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

        <FrameLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/frame"
            android:layout_above="@+id/bottomBar"
            />

    <com.roughike.bottombar.BottomBar
        android:id="@+id/bottomBar"
        android:layout_width="match_parent"
        android:layout_height="56dp"
        android:gravity="bottom"
        app:bb_tabXmlResource="@xml/bottombar_tabs_color_changing"
        app:bb_behavior="shifting|shy|underNavbar" />
 </android.support.design.widget.CoordinatorLayout>

最佳答案

使用 android:layout_gravity="bottom" 它会起作用!

关于android - 底栏未在底部对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42110751/

相关文章:

安卓图标没有出现

xml - 在bash中生成XML,需要一些有效的想法

java - Android 选项卡式 Activity 底部关闭屏幕

java - 从光标填充 ListView

android - CoordinatorLayout - 朝相反的方向摆动会导致抖动

带有折叠工具栏的 RecyclerView 中的 Android 字母快速 ScrollView

android - 在 Android 中的自定义启动器应用程序中隐藏应用程序列表中的启动器 Activity

java - 如何知道从另一个android应用程序可读的可能参数

java - 在线性布局中将 TextView 置于 ImageView 正下方

AndroidManifest.xml <manifest> 包属性没有命名空间