Android的工作室 - XML编辑器自动完成不工作的支持库编辑器、自动完成、工作室、工作

2023-09-04 09:56:16 作者:你怎么这么可爱啊

我刚开始使用新的android.support.design库。当使用任何XML编辑器内的小部件我停止获取XML自动完成建议!

I just started using the new android.support.design library. When using any of the widgets inside the XML editor I stop getting the XML autocomplete suggestions!

例如,

<android.support.design.widget.CoordinatorLayout
    android:id="@+id/header_root"
    android:layout_width="match_parent"
    android:layout_height="200dp">

    <ImageView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/primary_dark" />

    <android.support.design.widget.FloatingActionButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|right"
        android:src="@drawable/ic_action_add"
        android:layout_marginLeft="16dp"
        android:layout_marginRight="16dp"
        android:layout_marginTop="56dp"
        app:fabSize="normal"
        app:layout_anchor="@id/header_root"
        app:layout_anchorGravity="bottom|right|end" />

</android.support.design.widget.CoordinatorLayout>

无标签将显示自动完成弹出,就像当我开始输入机器人:我没有弹出出现时,我得到的唯一的建议显示在下面的图片

None of the tags will show the autocomplete popup, like when I start typing "android:i" no popup appears, the only suggestion I get is shown in the following picture.

我试图清理我的项目,重新启动计算机,重新启动机器人工作室..没有什么工作!

I have tried cleaning my project, restarting the pc, restarting Android Studio.. nothing is working!

推荐答案

有关我的答案 @ user4989692 没有工作。我曾尝试东西(重新启动Android的工作室,电脑,废止高速缓存,省电模式,...)。很多

For me the answer from @user4989692 did not work. I have tried alot of things (restart Android Studio, PC, Invalidate Caches, Power Saver mode,...).

最后,删除 .idea 文件夹和所有的 .iml 从项目文件,重新启动的Andr​​oid Studio和重建摇篮的伎俩。自动完成的XML支持库恢复工作。

Finally, deleting .idea folder and all .iml files from the project, restarting Android Studio and rebuilding gradle did the trick. Autocomplete in XML support library is working again.

大概检查了从版本控制文件或复制一个新的项目会做的伎俩藏汉所有的源文件。

Probably checking out files from Version Control or copying all the source files in a new project would do the trick aswell.