简体   繁体   English

Android:滑动视图而无需其他支持库

[英]Android: Swipe Views without additional support library

I have no interest in backward support for < 4.0 devices. 我对向后支持<4.0设备不感兴趣。 And also, I would like to get rid of support libraries to make package as small as possible. 而且,我想摆脱支持库以使程序包尽可能小。

Is it possible to create similar effect only using 4.0+ native fragments? 是否可以仅使用4.0以上的本机片段来创建类似的效果?

ViewPager is not tied to any fragments. ViewPager未绑定任何片段。 You are welcome to use ViewPager with: 欢迎您将ViewPager用于:

  • the fragment backport, or 片段回传,或
  • native API Level 11+ fragments, or 本机API级别11+片段,或
  • no fragments at all, using Views for the pages 完全没有碎片,使用页面Views

You are also welcome to copy the source code to ViewPager and PagerAdapter into your project. 也欢迎您将源代码复制ViewPagerPagerAdapter到您的项目中。 If you would like to use FragmentPagerAdapter or FragmentStatePagerAdapter with native API Level 11+ fragments, you can copy the source code to the v13 editions of those classes into your project as well. 如果您想将FragmentPagerAdapterFragmentStatePagerAdapter与本机API Level 11+片段一起使用,则可以将源代码复制到这些类的v13版本中 ,也可以复制到您的项目中。

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

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