【发布时间】:2015-07-08 06:50:23
【问题描述】:
我已经实现了一个导航抽屉。在导航抽屉的 FrameLayout 中,我添加了一个片段,其中包含 2 个 ViewPager,每个 ViewPager 正好占屏幕的一半。现在我想在这两个查看器的交界处添加一个 FAB 按钮,如下所示。
在我的例子中,两个浏览器都占据了半屏,这与图像中显示的略有不同。有人可以帮我在路口拿到 FAB。
包含 2 个浏览器的片段代码如下:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.view.ViewPager
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/shirt_section"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="0dp" />
<android.support.v4.view.ViewPager
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/pant_section"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="0dp" />
</LinearLayout>
【问题讨论】:
标签: android android-fragments android-viewpager floating-action-button