What is the difference between Theme.AppCompat and Theme.Material in Android?

笑着哭i 提交于 2019-12-13 12:26:21

问题


In My case, what is difference in here:

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

and

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

回答1:


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

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

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

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.

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




回答2:


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

Theme.Appcompact is for above API 7+

Theme.Material is for above API 21+



来源:https://stackoverflow.com/questions/43455884/what-is-the-difference-between-theme-appcompat-and-theme-material-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!