【发布时间】:2018-03-26 10:24:16
【问题描述】:
我有一个 android 片段布局,我想将我的页面视图放在滚动视图中。当应用程序在没有滚动视图的情况下运行时,它正在显示的图像,但是当我将页面视图代码放在滚动视图中时,它没有显示的图像。
这是我的代码
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.wk.sigah.FragmentHome"
android:background="@color/colorPrimary">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.view.ViewPager
android:id="@+id/viewImage"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</android.support.v4.view.ViewPager>
</ScrollView>
</LinearLayout>
【问题讨论】:
-
为什么需要滚动视图?如果您希望页面滚动,请使用 scrollview 制作您的视图寻呼机的片段 xml
-
为什么要把
viewpager放在scrollview中? -
@JyotiJK 我只想将我的页面视图用于顶部的图像滑块,然后在其后放置一些文本
标签: java android fragment scrollview