在 Android Studio 中更改项目主题? [英] Change the project theme in Android Studio?

查看:25
本文介绍了在 Android Studio 中更改项目主题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用浅色主题创建了一些项目,现在我想将其更改为深色,但我不知道该怎么做.顺便说一句,我不是在问如何在代码中做到这一点,而是如何更改项目的默认主题.

I created some project using the light theme and now I want to change it to dark and I can't figure out how to do that. BTW, I'm not asking on how to do it in code, just how to change the project's default theme.

推荐答案

在 AndroidManifest.xml 中的 application 标签下,您可以设置您选择的主题.要自定义主题,请在 Android 清单文件中的 android:theme = "@style/AppTheme" 上按 Ctrl + Click.它将打开 styles.xml 文件,您可以在其中更改样式标记的父属性.

In the AndroidManifest.xml, under the application tag, you can set the theme of your choice. To customize the theme, press Ctrl + Click on android:theme = "@style/AppTheme" in the Android manifest file. It will open styles.xml file where you can change the parent attribute of the style tag.

styles.xmlparent= 处,您可以使用 "" 中的自动完成功能浏览所有可用的样式.例如.尝试 parent="Theme." 将光标放在 . 之后,然后按 Ctrl + Space.

At parent= in styles.xml you can browse all available styles by using auto-complete inside the "". E.g. try parent="Theme." with your cursor right after the . and then pressing Ctrl + Space.

您还可以在 Android Studio 的预览窗口中预览主题.

You can also preview themes in the preview window in Android Studio.

这篇关于在 Android Studio 中更改项目主题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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