如何设置ViewPager大小 [英] How to set ViewPager size
本文介绍了如何设置ViewPager大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以设置viewpager的大小? 喜欢此搜索, 我想说明3页在同一个屏幕上。
Could I set the viewpager's size? like the image1, I want to show 3-page in the same screen.
如果没有,我只能用的LinearLayout?
If not, I can only use LinearLayout?
推荐答案
您的问题类似于一个CommonWare的博客。 多视图ViewPager选项
有三种方法。其中之一是覆盖 getPageWidth()
在PagerAdapter:
Your problem is similar to one CommonWare's blog. Multiple-View ViewPager Options
There are three approach. One of those is override getPageWidth()
in your PagerAdapter:
@Override public float getPageWidth(int position) { return(0.5f); }
该有的比较复杂,但也很重视源和长的解释,所以我不复制到这里。
The others are more complicated but there're attach source and long explanation so i don't copy here.
这篇关于如何设置ViewPager大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文