Android中的Theme.AppCompat和Theme.Material有什么区别? [英] What is the difference between Theme.AppCompat and Theme.Material in Android?

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

问题描述

就我而言,这有什么区别:

In My case, what is difference in here:

<style name="AppTheme" parent="android:Theme.Material.Light.DarkActionBar">

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">

推荐答案

<style name="AppTheme" parent="android:Theme.*">

这是针对Android 5+设计的原始Material设计主题.

This is the raw Material design theme, designed for Android 5+

<style name="AppTheme" parent="Theme.AppCompat.*">

这是在棒棒糖之前的设备上使用材料设计的一种方法(因此与应用程序兼容).您可以使用AppCompat设计较新的API,这样它就可以在比起始API级别更早的API级别上工作.

This is a way to use material design on pre-lollipop devices(thus app compatibility). You can design for newer API's using AppCompat and as such have it work on earlier API levels than what the starting API level is.

在这种情况下,这意味着您可以在没有材料设计的平台上运行Material Design(意味着Android 5之前的版本)

In this case, it means you can run Material Design on platforms that doesn't come with material design(meaning pre-Android 5)

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

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