Multiple pages at the same time on a ViewPager(ViewPager 上同时显示多个页面)
问题描述
当使用 ViewPager 时,是否有可能同时显示两个页面?我不是在寻找边缘效果,而是同时寻找两个完整页面.
Is there a possibility to display two pages at the same time, when using a ViewPager? I'm not looking for an edge effect, but rather for two full pages at the same time.
推荐答案
请看一下对应PagerAdapter中的getPageWidth方法.覆盖它并返回例如0.8f 让所有子页面仅跨越 ViewPager 宽度的 80%.
Please have a look at the getPageWidth Method in the corresponding PagerAdapter. Override it and return e.g. 0.8f to have all child pages span only 80% of the ViewPager's width.
更多信息:http://developer.android.com/参考/android/support/v4/view/PagerAdapter.html#getPageWidth(int)
这篇关于ViewPager 上同时显示多个页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:ViewPager 上同时显示多个页面
基础教程推荐
- 如何从 logcat 中删除旧数据? 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
