【发布时间】:2017-08-24 23:39:53
【问题描述】:
我有一个带有协调器布局的活动。协调器布局内部是一个视图,它继承了 Google 支持库底部表的默认底部表布局行为。问题是当我以协调器布局作为视图调用 Snackbar.show() 时,底页也会弹出。
这是显示快餐栏的调用:
Snackbar.make(coordinatorLayout, R.string.status_image_saved,
Snackbar.LENGTH_SHORT).show();
这是布局:
<android.support.design.widget.CoordinatorLayout>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout>
<android.support.v7.widget.Toolbar />
</android.support.design.widget.AppBarLayout>
<android.support.v7.widget.RecyclerView />
</android.support.constraint.ConstraintLayout>
<LinearLayout
android:id="@+id/attachment_selector"
android:layout_width="match_parent"
android:layout_height="480dp"
android:background="@color/colorBack"
android:elevation="10dp"
android:orientation="vertical"
app:behavior_hideable="true"
app:behavior_peekHeight="@dimen/bottom_sheet_start"
app:layout_behavior="android.support.design.widget.BottomSheetBehavior">
<android.support.design.widget.TabLayout
android:id="@+id/attachment_selector_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabGravity="fill"
app:tabMode="fixed" />
<android.support.v4.view.ViewPager
android:id="@+id/attachment_pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
【问题讨论】:
-
你找到解决办法了吗?
标签: android