内容简介:将您的寻呼机行包装在CustomScrollView中,而不是将寻呼机包装在CustomScrollview中.并且不要像Piyush Gupath评论的那样修复Viewpager的高度.使用wrapcontent.翻译自:https://stackoverflow.com/questions/20000018/set-viewpager-height-inside-scrollview-in-android
<com.xxx.myapp.android.ui.CustomScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fadingEdge="none"
android:fillViewport="true"
android:gravity="center">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants"
android:orientation="vertical" >
<android.support.v4.view.ViewPager
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="800dp"
android:layout_gravity="top"
android:layout_marginTop="10dp" />
</LinearLayout>
</com.xxx.myapp.android.ui.CustomScrollView>
这里是 CustomScrollView .问题是如何根据子高度设置视图寻呼机高度,以便我可以滚动屏幕直到视图寻呼机项目结束.如果我将view pager height设置为wrapcontent,则viewpager中不会显示任何内容.如果我设置了800dp,那么我可以看到寻呼机项目,但屏幕上有不必要的滚动.我不希望我的滚动视图滚动超出寻呼机儿童的高度.请帮我.
将您的寻呼机行包装在CustomScrollView中,而不是将寻呼机包装在CustomScrollview中.并且不要像Piyush Gupath评论的那样修复Viewpager的高度.使用wrapcontent.
翻译自:https://stackoverflow.com/questions/20000018/set-viewpager-height-inside-scrollview-in-android
以上所述就是小编给大家介绍的《在android中的Scrollview中设置Viewpager高度》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
How to Solve It
Zbigniew Michalewicz、David B. Fogel / Springer / 2004-03-01 / USD 59.95
This book is the only source that provides comprehensive, current, and detailed information on problem solving using modern heuristics. It covers classic methods of optimization, including dynamic pro......一起来看看 《How to Solve It》 这本书的介绍吧!