是否在Android ICS API有一个本机相当于ViewPager支持LIB? [英] Does the Android ICS API have a native equivalent to ViewPager support lib?

查看:84
本文介绍了是否在Android ICS API有一个本机相当于ViewPager支持LIB?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我寻觅了一下四周传呼机的片段,我制定ICS API。

我知道ViewPager和所有支持库的早期版本,但我不明白我为什么要使用一个支持库认为,我用的是API的最新版本,并且不打算支持早期版本的事实。

我一定要写出了ViewPager我自己或者是有什么我没在API看到的。

解决方案
  

难道是Android ICS API有一个本机相当于ViewPager支持LIB?

没有。

  

我知道ViewPager和所有支持库的早期版本,但我不明白我为什么要使用一个支持库认为,我用的是API的最新版本,并且不打算支持早期版本的事实。

Android的支持包不仅对新API的反向移植。也正因为如此,无论出于何种原因,没有被添加到该SDK的其他类,如 ViewPager 及其支持类。

  

我一定要写出了ViewPager我自己或者是有什么我没在API看到的。

欢迎您来写自己的实现视图页面组件。精明的程序员会使用一个在Android的支持包,因为它已经书面和(大部分)调试。

更新:注意 ViewPager 工作得很好与那些网页:

  • 在API等级11+原生片段
  • 支持Android回迁片段
  • 任意浏览

对于第一种情况,你需要的 V13 版本的支持JAR,其中包含 V13 的版本 FragmentPagerAdapter FragmentStatePagerAdapter 类。

I have searched a bit around for a pager for fragment , I develop on ICS API.

I know about ViewPager and all the support libs for earlier version but i don't get why I should use a support library consider the fact that I use the lastest version of the api and don't plan to support earlier version.

Do I have to write the "ViewPager" myself or is there something i didn't see in the api.

解决方案

Does the Android ICS API have a native equivalent to ViewPager support lib?

No.

I know about ViewPager and all the support libs for earlier version but i don't get why I should use a support library consider the fact that I use the lastest version of the api and don't plan to support earlier version.

The Android Support package is not only for backports of newer APIs. It is also for other classes that, for whatever reason, are not being added to the SDK, such as ViewPager and its supporting classes.

Do I have to write the "ViewPager" myself or is there something i didn't see in the api.

You are welcome to write your own implementation of a view paging component. Savvy programmers would use the one in the Android Support package, since it is already written and (mostly) debugged.

UPDATE: Note that ViewPager works just fine with pages that are:

  • API Level 11+ native fragments
  • Android Support backported fragments
  • arbitrary Views

For the first case, you need the v13 version of the support JAR, which contains v13 versions of the FragmentPagerAdapter and FragmentStatePagerAdapter classes.

这篇关于是否在Android ICS API有一个本机相当于ViewPager支持LIB?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆