我在一个“Coordinator Layout”中有一个“FAB”按钮,并设置了弹出 Snackbar。但是,如果一个 Snackbar 是可见的,并且我在第一个 Snackbar 仍然可见时执行触发另一个 Snackbar 的操作,则 FAB 按钮会出现故障,并落在 Snackbar 后面。它没有随着 Snackbar 移动。
我在“相对布局”中拥有“Coordinator Layout”,并在“Coordinator Layout”下方放置了一个“adview”。
以下是“layout.xml”文件的内容:
我在“相对布局”中拥有“Coordinator Layout”,并在“Coordinator Layout”下方放置了一个“adview”。
以下是“layout.xml”文件的内容:
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/background">
<RelativeLayout
android:id="@+id/circle2"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.CoordinatorLayout
android:id="@+id/container2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/adView"
android:background="#FFF3E0"
tools:context=".MainActivity"
android:orientation="vertical">
<SurfaceView
android:layout_width="0px"
android:layout_height="0px"
android:visibility="gone" />
<include
android:id="@+id/circle"
layout="@layout/periodictablelayout" />
<include
android:id="@+id/toolbar_actionbar"
layout="@layout/toolbar_default"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="@+id/container"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginTop="?android:attr/actionBarSize"
/>
<android.support.design.widget.FloatingActionButton
android:id="@+id/periodbutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginEnd="16dp"
android:elevation="3dp"
android:onClick="onClick"
app:layout_anchorGravity="bottom|right|end"
app:layout_anchor="@+id/container2"
android:src="@drawable/ic_view_comfy_white_24dp"
app:backgroundTint="@color/accent"
android:layout_gravity="bottom|end"
app:layout_behavior="ibochemistry.titomo.timetoolay.google.com.ibchemistry.ScrollAwareFABBehaviour" />
</android.support.design.widget.CoordinatorLayout>
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
ads:adSize="BANNER"
ads:adUnitId="@string/banner_ad_unit_id"
app:layout_anchorGravity="bottom" />
</RelativeLayout>
<!-- android:layout_marginTop="?android:attr/actionBarSize"-->
<fragment
android:id="@+id/fragment_drawer"
android:name="ibo.NavigationDrawerFragment"
android:layout_width="@dimen/navigation_drawer_width"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginTop="@dimen/abc_action_bar_default_height_material"
app:layout="@layout/fragment_navigation_drawer"
tools:layout="@layout/fragment_navigation_drawer" />