ViewPager滚动型中没有滚动条 [英] ViewPager in ScrollView no Scrollbar
本文介绍了ViewPager滚动型中没有滚动条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的XML风格我用android.support.v4.view.ViewPager滚动型内。问题是,我不得到滚动条。此外,当我从一个页面滑动到另一个ViewPager本身的行为很奇怪。
in my xml style I use a android.support.v4.view.ViewPager within a ScrollView. The problem is that I dont get a scrollbar. The ViewPager itself behaves also strange when I slide from one page to another.
设置滚动型到一个固定的高度例如1200dip有助于滚动,但犯规显示ViewPager。
这里是我的xml:
Setting the ScrollView to a fixed height e.g. 1200dip helps to scroll but doesnt show the ViewPager. Here is my xml:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fadeScrollbars="true"
android:fillViewport="true"
android:scrollbars="vertical" >
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/menu"
/>
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</android.support.v4.view.ViewPager>
</RelativeLayout>
</ScrollView>
在此先感谢
推荐答案
找到了解决办法 -
<一个href=\"http://stackoverflow.com/questions/2646028/android-horizontalscrollview-within-scrollview-touch-handling\">Android - 滚动型触摸内HorizontalScrollView处理
这篇关于ViewPager滚动型中没有滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文