当我将<merge>作为<layout>

时间:2018-02-07 18:09:51

标签: android-layout android-studio intellij-idea autocomplete intellisense

我的布局中有以下内容;

<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:descendantFocusability="beforeDescendants"
    android:id="@+id/layoutId">

    <data>
        <variable name="data" type="com.example.android.Person"/>
    </data>

        <TextView ... //**YES** Intellisense or autocompletion

    <merge>

        <TextView ... //No Intellisense or autocompletion

        <Spinner ... //No Intellisense or autocompletion

    </merge>
</layout>

我试图在<merge>标记内使用的任何XML标记都不会弹出智能感知或自动完成。

我尝试了以下内容;

  1. 文件 - &gt;无效缓存/重新启动... - &gt;选择“无效并重新启动”
  2. 文件 - &gt;省电模式
  3. 删除.idea文件夹和所有.iml并重建。
  4. 似乎没什么用。

    智能感知/自动完成功能之外标签,但不在其中。

    拜托,有没有人有解决方案?

    临时修复

    我将<merge>更改为Android ViewGroup(在我的情况下为LinearLayout),然后在我的根布局中使用了ViewStub

1 个答案:

答案 0 :(得分:1)