【问题标题】:XML items doesn't match correctlyXML 项目不正确匹配
【发布时间】:2017-08-16 17:29:19
【问题描述】:

我的 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.

这是问题的图片:

您知道什么可能导致此布局问题吗? 谢谢大家。

【问题讨论】:

标签: android xml layout snackbar bottombar


【解决方案1】:

我认为问题在于 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"/>

【讨论】:

猜你喜欢
  • 2019-08-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-09-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多