简体   繁体   English

结合父布局的垂直scoll视图和视图分页器的内容

[英]Combine Vertical scoll view of parent layout and contents of view pager

I have a 'page' that has a number of components on it, and who's content is longer than the height of the device. 我有一个“页面”,上面有许多组件,谁的内容长于设备的高度。 one of the component is view pager. 组件之一是视图寻呼机。 Content of view pager is also very large. 视图分页器的内容也非常大。 How can i combine vertical scroll view of parent layout and view pager layout.My laytout is as follows: 我如何将父级布局的垂直滚动视图和分页器布局合并在一起。我的布局如下:

few components 组件少

view pager-(large content in another layout) 查看寻呼机-(在其他布局中显示大内容)

few more component 其他一些组件

i want to combine scroll view of view pager and parent layout 我想结合视图分页器和父布局的滚动视图

It should just work. 它应该工作。 See here -> ViewPager inside a ScrollView does not scroll correclty 看到这里-> ScrollView中的ViewPager不能滚动正确

You structure should be like this: 您的结构应如下所示:

ScrollView
-ViewPager
--ScrollView

Then just apply the suggestions made in the linked post above. 然后,只需应用上面链接文章中的建议即可。

Also make sure the ViewPager has a fixed height! 还要确保ViewPager具有固定的高度! Otherwise the ScrollView inside the ViewPager won't work without writing a custom ScrollView or ViewPager. 否则,如果不编写自定义ScrollView或ViewPager,则ViewPager中的ScrollView将无法工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM