布局预览在 Android Studio 中不起作用 [英] Layout preview not working in Android Studio

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

问题描述

我将一个 android 项目从 Eclipse 移植到了 Android Studio.该项目构建得很好.但是我看不到任何布局预览.当我转到布局的设计"选项卡时,我得到一个

I ported an android project from Eclipse to Android Studio. The project builds just fine. However I am not able to see any layout preview. When I go to the Design tab of a layout I get a

正在加载配置...

永不消失的消息(见图).

message that never goes away (see image).


我在项目结构中正确设置了Android SDK.所有 xml 文件都会发生这种情况,我无法从


I have set correctly the Android SDK in the project structure. This happens with all the xml files and I am not able to open the "Preview" window from

查看 -> 工具窗口 -> 预览

View -> Tool Windows -> Preview

我尝试创建一个新项目,但一切正常.我错过了什么吗?有人遇到过类似的问题吗?是否有可能因为文件夹结构不是默认结构而发生这种情况?(布局不在 project/src/main/res/layout 下,而是在 project/res/layout 下)

I tried creating a new project and everything was showing fine. Am I missing something? Anyone faced a similar issue? Is there a chance that this is happening because the folder structure is not the default one? (The layouts are not under project/src/main/res/layout but under project/res/layout)

推荐答案

试试这个

  1. 构建>清理项目
  2. Build> 重建项目

它对我有用

这篇关于布局预览在 Android Studio 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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