android.app.Fragment和android.support.v4.app.Fragment的区别 [英] Difference between android.app.Fragment and android.support.v4.app.Fragment

查看:164
本文介绍了android.app.Fragment和android.support.v4.app.Fragment的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

android.app.Fragment 的区别,什么是 android.support.v4.app.Fragment ,什么是其中每个应使用的情况?

What is the difference between android.app.Fragment and android.support.v4.app.Fragment, and what are the circumstances in which each should be used?

推荐答案

android.support.v4.app.Fragment Fragment 类在android支持库,这是一个兼容包,使您可以使用一些Android系统的新功能在旧版本的Andr​​oid。

android.support.v4.app.Fragment is the Fragment class in the android support library, which is a compatibility package that allows you to use some of the newer features of Android on older versions of Android.

android.app.Fragment 片段类在Android SDK的原生版本。据介绍在的Andr​​oid 3.0(API 11)。

android.app.Fragment is the Fragment class in the native version of the Android SDK. It was introduced in Android 3 (API 11).

如果你想使你的应用程序使用的片段,并希望API 11日之前到目标设备,则必须使用 android.support.v4.app.Fragment 。但是,如果你只针对以上运行的API 11台设备,你可以使用 android.app.Fragment

If you want to make your app use fragments, and want to target devices before API 11, you must use android.support.v4.app.Fragment. However, if you're only targeting devices running API 11 or above, you can use android.app.Fragment.

这篇关于android.app.Fragment和android.support.v4.app.Fragment的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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