我使用的是 android studio 版本 3.5.1,对于所有其他项目,它工作正常,但对于特定项目,xml 建议未显示。我已经尝试通过使缓存无效,删除 .idea
文件夹,但结果保持不变。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".xyz">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
最佳答案
我前阵子遇到过这个问题,并且能够按照以下步骤解决它;
- 关闭 Android Studio。
- 删除
C:\Users\{MyUsername}\.AndroidStudio3.5\system\caches\
目录的内容。 - 重新启动 Android Studio。
这应该会再次为您工作。希望对您有所帮助!
注意:我在这里的回答是对 prior answer I'd provided to a similar question 的轻微修改.我已经尝试了您在问题中提到的所有其他建议,除了我上面包含的那个之外,没有一个对我有用。
关于xml 中的 Android Studio 建议未针对特定项目显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58229097/