预览选项卡在 Android Studio 中不可见
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21140401/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Preview tab is not visible in Android Studio
提问by Sumit
I have installed an android studio and tried to create my first project. But preview tab is not visible. I checked it in the View -> Tools Window but the preview is also not present there.
我已经安装了一个 android studio 并尝试创建我的第一个项目。但预览选项卡不可见。我在“视图”->“工具”窗口中进行了检查,但那里也没有预览。
Even Design/Text tab is not visible in the android studio. I checked the earlier posts in stackoverflow but have not been able to resolve this problem. Like this one : Where is Android Studio layout preview?
在 android studio 中甚至看不到设计/文本选项卡。我查看了 stackoverflow 中较早的帖子,但未能解决此问题。像这样一个:Android Studio 布局预览在哪里?
Not able to show you the image as this is my first question and I have only 1 reputation. :(
无法向您展示图像,因为这是我的第一个问题,而且我只有 1 个声望。:(
Please suggest a way to find it.
请提出一种找到它的方法。
Thanks in advance
提前致谢
采纳答案by pyus13
As per the screenshot your project structure is not as per it should be. Reason is clearly visible in the picture, Your SDK buttons in tool bar are grayed in screen shot that means there is some problem in the SDK path.
根据屏幕截图,您的项目结构不应该是。原因在图片中清晰可见,您的工具栏中的SDK按钮在屏幕截图中是灰色的,这意味着SDK路径存在问题。
please set your SDK path from
请设置您的SDK路径
File > Project Structure > Android SDK
And after that sync your project with gradle using the tiny gradle button available in tool bar.
然后使用工具栏中可用的小 gradle 按钮将您的项目与 gradle 同步。
Not even the preview, you will not see any android specific tabs if your sdk path is not correct.
甚至没有预览,如果您的 sdk 路径不正确,您将看不到任何特定于 android 的选项卡。
For reference your studio will look like this after correct sdk
作为参考,您的工作室在正确的 sdk 后将如下所示
回答by M Hammond
I had the problem of not seeing a preview tab, or the design and text tab. After playing around with it for a while I found that the problem was that my Gradle was messed up. I went to the Gradle Console (bottom right corner of the screen) and opened it. I asked me to import Gradle project (the one I was working on) and it worked. Sorry if that doesn't make sense, I am very new to Android Studio
我遇到了看不到预览选项卡或设计和文本选项卡的问题。玩了一段时间后,我发现问题是我的 Gradle 搞砸了。我去了 Gradle 控制台(屏幕右下角)并打开它。我让我导入 Gradle 项目(我正在处理的项目)并且它起作用了。对不起,如果这没有意义,我对 Android Studio 很陌生