Android Studio Layout Preview 默认主题 [英] Android Studio Layout Preview Default Theme
问题描述
也许这是 Android Studio 中众所周知的选项,但我找不到它,Google 也没有帮我解决这个问题:( 每次我在 Android Studio 中打开布局预览时,它都会将 Material.Light 主题应用到我的每个布局中项目,我需要手动应用我自己的主题以查看它在实际应用程序中的外观.有人知道如何在使用 Android Studio 中的布局预览器预览布局时将默认 Material.Light 主题更改为我的自定义主题,所以我不不需要每次都手动应用吗?
Maybe this is well known option in Android Studio but I couldn't find it and Google has not helped me with this :( Every time I open a layout preview in Android Studio it's applying Material.Light theme to every layout in my project and I need manually apply my own theme to see how it will look like in a real app. Does somebody know how to change default Material.Light theme to be my custom theme when previewing layout with Layout Previewer in Android Studio so I don't need to apply it manually every time?
提前致谢.
推荐答案
单击此处将主题更改为您的主题.
Click here and change theme to your theme.
如果您希望始终打开单个主题,请给
If you want a single theme to always open, give
android:theme="@style/YourTheme"
在 Manifest 文件中的
标签中.
android:theme="@style/YourTheme"
in your <application>
tag in Manifest file.
从下次开始,当您创建新的 xml 文件时,这将成为您的默认主题.
From next time onwards, when you create a new xml file, this will be your default theme.
这篇关于Android Studio Layout Preview 默认主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!