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

查看:430
本文介绍了更改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.xml中的parent=中,您可以使用""中的自动完成功能浏览所有可用样式.例如.在.之后,用光标尝试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天全站免登陆