是否在Android ICS API有一个本机相当于ViewPager支持LIB?本机、有一个、ICS、Android

2023-09-03 22:07:47 作者:离开之后

我寻觅了一下四周传呼机的片段,我制定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.

菜鸟在进行一个android 程序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.