实现动作条的标签与V4片段API片段、动作、标签、API

2023-09-12 02:32:45 作者:沐雨昔年

我的应用程序正在使用该片段/ V4兼容包,以支持Android版本一路下跌至1.6。这意味着我所有的碎片片段的兼容包的版本继承。我目前正在重新修改应用程序的部分地区采取的蜂窝功能的优势,如动作条

My app is currently using the Fragments/v4 compatibility package to support Android versions all the way down to 1.6. This means all my Fragments inherit from the compatibility package's version of Fragment. I'm currently trying to rework parts of the app to take advantage of Honeycomb features, like ActionBar.

我已经用我自己的行动棒状的执行情况pre-3.0的设备,以及蜂窝操作栏,否则。该位是不是一个问题。

I already use my own action-bar-like implementation on pre-3.0 devices, and the Honeycomb Action Bar otherwise. This bit isn't an issue.

我的问题是试图实现使用动作条的标签。 ActionBar.TabListener 预计本机片段 FragmentTransaction 班工作 - 所以试图用我的片段类(从兼容性库继承)不编译

The problem I have is trying to implement tabs using the ActionBar. ActionBar.TabListener expects the native Fragment and FragmentTransaction classes to work - so trying to use my Fragment classes (which inherit from the compatibility library) doesn't compile.

所以,没有任何人有任何想法如何,我可以使用,使用片段的兼容包的版本片段动作条标签?

So, does anyone have any ideas how I can use fragments that use the compatibility package version of Fragment with ActionBar tabs?

tldr:?我该如何使用动作条的标签与从V4兼容性库继承片段

tldr: how can I use ActionBar tabs with fragments that inherit from the v4 compatibility library?

推荐答案

我问在Android开发人员邮件列表这个问题。

I asked this question on the android-developers mailing list.

我采取的方法是一个由CommonsWare,建议借此提供FragmentTransaction参数被完全忽略: http://groups.google.com/group/android-developers/msg/d8d84cdd2f753b71

The approach I've taken is the one suggested by CommonsWare, whereby the provided FragmentTransaction parameter is ignored entirely: http://groups.google.com/group/android-developers/msg/d8d84cdd2f753b71