0

我的 Android 应用程序有问题。我正在尝试修复我的小吃店的布局,因为它不适合我的 BottomBar。如果您看到我发布的图片,您会看到两个项目之间有一个不应该出现的小空间。

我会给你看一些代码。在我的 MainActivity 中有我的 BottomBar 和 FrameLayout。我的 Snackbar 出现在我的 Fragment 上(在那个框架布局中)。

MainActivity.xml:

   <FrameLayout
    android:id="@+id/fragment_container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_below="@+id/imageview_logo"
    android:layout_above="@id/bottomBar"
    android:layout_alignParentStart="true">
    </FrameLayout>

    <com.roughike.bottombar.BottomBar
    android:id="@+id/bottomBar"
    android:layout_width="match_parent"
    android:layout_alignParentBottom="true"
    app:bb_tabXmlResource="@xml/bottombar_tabs"
    android:layout_height="60dp"
    app:bb_inActiveTabColor="@color/inActiveTabColor"
    app:bb_inActiveTabAlpha="0.8"
    app:bb_activeTabAlpha="1" />

片段.java

This is the java class that shows my Snackbar.

这是问题的图片:

在此处输入图像描述

你知道什么可能导致这个布局问题吗?谢谢你们。

4

1 回答 1

0

我认为问题在于 BottomBar 本身的阴影。您可以在 xml 文件中将 BottomBar 的属性“showshadow”设置为 false 来解决此问题。

 <com.roughike.bottombar.BottomBar
    android:id="@+id/bottomBar"
    android:layout_width="match_parent"
    android:layout_alignParentBottom="true"
    app:bb_tabXmlResource="@xml/bottombar_tabs"
    android:layout_height="60dp"
    app:bb_inActiveTabColor="@color/inActiveTabColor"
    app:bb_inActiveTabAlpha="0.8"
    app:bb_activeTabAlpha="1"
    app:bb_showShadow="false"/>
于 2017-03-24T10:43:56.763 回答