实现动作条的标签与V4片段API [英] Implementing ActionBar tabs with v4 Fragments API

查看:128
本文介绍了实现动作条的标签与V4片段API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序正在使用该片段/ 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参数被完全忽略: <一href="http://groups.google.com/group/android-developers/msg/d8d84cdd2f753b71">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

这篇关于实现动作条的标签与V4片段API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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