“不推荐使用 TabActivity 类型"对于应用程序选项卡 [英] "The type TabActivity is deprecated" For app tab

查看:25
本文介绍了“不推荐使用 TabActivity 类型"对于应用程序选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

TabActivity 类型已弃用"?

"The type TabActivity is deprecated"?

我正在按照教程书制作应用程序的标签.

I am making the Tabs of app following tutorial book.

我已经从 android developer.com 网站查看过,但我不知道以下消息的意义:This class is deprecated.

I've checked from the android developer.com website, but i have no ideas on the significance of the following message : This class is deprecated.

新的应用程序应该使用 Fragments 而不是这个类;要继续在旧设备上运行,您可以使用 v4 支持库,它提供了与 DONUT 兼容的 Fragment API 版本."* (http://developer.android.com/reference/android/app/TabActivity.html)

New applications should use Fragments instead of this class; to continue to run on older devices, you can use the v4 support library which provides a version of the Fragment API that is compatible down to DONUT."* (http://developer.android.com/reference/android/app/TabActivity.html)

  1. 什么是 v4 支持库?
  2. 如何完成标签功能?

推荐答案

您仍然可以使用已弃用的包.但是,建议使用 Fragments 以及支持包.您可以在这里了解更多信息.但是,如果您是 java 和 android 开发的初学者,我建议您暂时忽略弃用,当您完成当前使用的教程后,如果您觉得它具有教育意义,请返回.

You can still use a deprecated package. It is however recommended to use Fragments, and thus the support package. You can read more about it here. However, if you are a beginner at java and android development, I would recommend ignoring the deprecation for now and come back to this when you have completed the tutorial you are currently using if you find it educating.

如果您想观看使用 Fragments 的选项卡式导航的一个很好的示例,请使用 android 4.0 或更高版本在 Eclipse 中创建一个新项目.确保您的 android-plugin 已更新.您将可以选择创建一个已实现基本导航的项目.

If you want to watch a nice example of tabbed navigation using Fragments, then create a new project in Eclipse using android 4.0 or later. Make sure your android-plugin is updated. You will get the option to create a project with basic navigation already implemented.

这篇关于“不推荐使用 TabActivity 类型"对于应用程序选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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