什么是AppCompat? [英] What is AppCompat?

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

问题描述

我想在我的应用程序中使用Material Design,但我的应用程序应基于软糖而不是棒棒糖.所以我的问题是:

I want to use Material Design in my app, but my app should be based on Jellybean not Lollipop. So my question is:

  1. 我想使用 com.android.support:appcompat-v7:23.1.1 .这可以解决我的问题吗?

  1. I want to use com.android.support:appcompat-v7:23.1.1. Is this a possible solution for my problem?

我想进一步了解 compileSdkVersion minSdkVersion :如果compileSdkVersion为20而minSdkVersion为18,那么,如果我使用一些材料设计(在Lollipop,sdk20中),如fab, cardview .如果我在豆形软糖设备中运行我的应用程序可以吗?(它是 SdkVersion 18 ,与 minSdkVersion 相同)?

I want to know more about compileSdkVersion and minSdkVersion: If compileSdkVersion is 20 and minSdkVersion is 18, then, if I use some material design(in Lollipop, sdk20) like fab, cardview. Is it fine if I run my app in jellybean device?(which is SdkVersion 18, same with minSdkVersion)?

推荐答案

发布新版本的android时,Google必须支持较旧的android版本.因此,AppCompat是一组支持库,可用于使使用较新版本开发的应用程序与较旧版本一起使用.

When new versions of android are published, Google will have to support the older versions of android. So AppCompat is a set of support libraries which can be used to make the apps developed with newer versions work with older versions.

例如:当您创建一个Api最低级别为9且目标api级别为21的android项目时,还应使用ActionBar,Drawer Menu(较新的功能,因为它们在Api 9中不存在)等较新的功能.在Api Level 10手机中受支持.然后,您可以使用appCompat库.因此,android actionbar将变为androidsupport actionbar/supportFragment等.

For example: When you create an android project with minimum Api level 9, and target api level 21, The newer features like ActionBar, Drawer Menu (Newer in the sense that they were not present in Api 9) etc should also be supported in Api Level 10 phones. Then, you can use the appCompat library. So the android actionbar will become androidsupport actionbar/ supportFragment etc.

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

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