什么是Android Studio中的向后兼容性? [英] What is Backwards Compatibility in Android Studio?

查看:243
本文介绍了什么是Android Studio中的向后兼容性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Android开发的新手.即使我提到了android开发人员网站,我也没有弄清楚.

I'm a newbie to Android Development. Even though I referred the android developer website, I didn't figure out.

在自定义活动对话框中,当我在Android Studio 2.3.1中取消选中Backwards Compatiblity(Appcompat)时,它给了我提示:

On the customize Activity dialog box, when I unchecked the Backwards Compatiblity(Appcompat) in Android Studio 2.3.1 It gave me a hint as:

如果为false,则此活动基类将是Activity而不是AppCompatActivity

通常,Android开发人员更喜欢什么?是向后兼容还是没有向后兼容?谁能解释我哪个更好.

Generally, what do android developers prefer? enabling backwards compatibility or without it? Can anyone explain me which one is better.

推荐答案

Android应用可以向后兼容,而无需选中此复选框.

Android apps can be backward-compatible without checking this checkbox.

如果为false,则此活动基类将是Activity而不是AppCompatActivity

If false, this activity base class will be Activity instead of AppCompatActivity

Android Studio会让您知道,如果您取消选中向后兼容性(Appcompat)"框,则将包含&使用库Activity而不是AppCompatActivity. 要对两者进行更详细的比较,请检查以下内容: Activity,AppCompatActivity, FragmentActivity和ActionBarActivity:何时使用哪个?

Android studio is letting you know that if you uncheck the "Backwards Compatability(Appcompat)" box, then you'll be including & using the library Activity instead of AppCompatActivity. For a more detailed comparison between the two, check this: Activity, AppCompatActivity, FragmentActivity, and ActionBarActivity: When to Use Which?

通常,Android开发人员更喜欢什么?是向后兼容还是没有向后兼容?

Generally, what do android developers prefer? enabling backwards compatibility or without it?

"CommonsWare"撰写的评论最好地解释了这一点:

A comment written by "CommonsWare" explains this best:

与未选中该复选框的活动相比,向后兼容的活动不具有向后兼容性.选中该复选框可为您的应用提供特定的外观,并在某些较旧的设备上保留该外观;如果未选中此复选框,则表示您的外观在某些方面与Android 5.0之前的设备有所不同.但是,这不会影响活动的核心功能. – CommonsWare

An activity created with that checkbox checked is no more backwards compatible than is one without that checkbox checked. Checking the checkbox gives your app a particular look and feel that will retain that look and feel on some older devices; leaving the checkbox unchecked means that some aspects of your look and feel will be different on pre-Android 5.0 devices. This does not impact the core functionality of the activity, though. – CommonsWare

这篇关于什么是Android Studio中的向后兼容性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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