简体   繁体   English

Android Studio 未显示 XML 布局的预览

[英]Android Studio not showing preview for XML layouts

I am trying to create a side navigation bar and i am designing the side navigation drawer but the layout is not showing in preview.我正在尝试创建一个侧面导航栏,并且我正在设计侧面导航抽屉,但布局未在预览中显示。 According to stack-overflows answers i tried to solve by changing app theme and cache data but none worked for me, is there anything xml attribute i am missing here?根据堆栈溢出的答案,我试图通过更改应用程序主题和缓存数据来解决,但没有一个对我有用,我在这里缺少什么 xml 属性吗? or i have to initialize it in java class?或者我必须在 java class 中初始化它? (i haven't initialized navigation bar in my java class). (我还没有在我的 java 类中初始化导航栏)。 i am newbie in android so please help me.我是 android 的新手,所以请帮助我。 Here is the preview of my problem.这是我的问题的预览。 在此处输入图像描述

Have you tried using the side navigation drawer that comes as a default activity, You can use this to familiarise yourself with the code, hence making it simpler to make your own custom side-nav drawer.您是否尝试过使用作为默认活动的侧导航抽屉,您可以使用它来熟悉代码,从而使制作自己的自定义侧导航抽屉变得更简单。

If you need more help customising your drawer check out this link , it might help you out a bit.如果您在定制抽屉时需要更多帮助,请查看此链接,它可能会对您有所帮助。 For java.对于 java。

This one for kotlin .这个是kotlin

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM