【发布时间】:2018-10-12 07:05:28
【问题描述】:
我有一个包含 ViewPager 的 Fragment,它允许用户滑动浏览三个 Fragment。
问题是:我希望 ViewPager 的背景在用户滑动浏览片段时保持固定。我尝试在我的可绘制对象中设置一个图像作为 ViewPager 的背景,但这没有用。这是我的代码:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/blue"
tools:context=".fragments.cash.WalletFragment">
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:background="@drawable/revenue"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
【问题讨论】:
标签: android xml background android-viewpager