如何在Android 5.0之前的设备上使用材质设计主题
我正在启动一个应该使用材质设计主题的应用程序 但该项目的minSDK为api 15级如何在Android 5.0之前的设备上使用材质设计主题,android,material-design,android-5.0-lollipop,Android,Material Design,Android 5.0 Lollipop,我正在启动一个应该使用材质设计主题的应用程序 但该项目的minSDK为api 15级 如何设置应用程序,使其在Android的较低版本上尽可能多地使用材质设计?我遵循了道奇推荐的指南 加 你的依赖关系 现在将样式放入“值”文件夹: <resources> <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"
如何设置应用程序,使其在Android的较低版本上尽可能多地使用材质设计?我遵循了道奇推荐的指南 加 你的依赖关系 现在将样式放入“值”文件夹:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- colorPrimary is used for the default action bar background -->
<item name="colorPrimary">@color/primary</item>
<!-- colorPrimaryDark is used for the status bar -->
<item name="colorPrimaryDark">@color/primary_dark</item>
<!-- colorAccent is used as the default value for colorControlActivated
which is used to tint widgets -->
<item name="colorAccent">@color/accent</item>
<!-- You can also set colorControlNormal, colorControlActivated
colorControlHighlight & colorSwitchThumbNormal. -->
</style>
</resources>
@颜色/原色
@颜色/原色/深色
@颜色/口音
现在,您必须将其添加到清单中的应用程序中:
<application
android:name=".BaseApplication"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
此设置继承了NoActionBar主题,使其也可以使用compat工具栏。您可以在此处找到它,backport:
<application
android:name=".BaseApplication"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">