Android Studio-ActionBar未显示在预览中 [英] Android Studio - ActionBar not displayed in the preview

查看:271
本文介绍了Android Studio-ActionBar未显示在预览中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在设备上运行应用程序时,可以看到ActionBar,但是在预览部分中却没有.

The ActionBar is visible when running the app on the device, however it is not in the preview section.

在预览中: https://i.stack.imgur.com/dNjAz.png

在设备上: https://i.stack.imgur.com/IjIHn.png

这是styles.xml

This is the styles.xml

<!-- Base application theme. -->
<style name="Theme.AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>

如何使ActionBar也出现在预览中? 谢谢.

How can I make the ActionBar appear on the preview also? Thank you.

推荐答案

我也遇到了同样的问题,我认为找到了解决方法

I dealt with the same problem and I think found a solution

  1. 首先打开布局编辑器窗口,然后单击左上角的眼睛,如下所示,然后单击显示布局装饰"

  1. 您也可以在那里更改应用主题,因此您的工具栏,操作栏等...

这篇关于Android Studio-ActionBar未显示在预览中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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