我正在尝试使用数据绑定到我现有的项目。作为其中的一部分,最初我试图摆脱所有 findViewById() 方法。
现在的问题是,我的布局如下:-
<merge >
<include
android:id="@+id/my_login_process_view"
layout="@layout/content_my_message_view"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</merge>
Run Code Online (Sandbox Code Playgroud)
将 android 绑定添加到此布局(将布局添加为父标签)后,它会抛出如下错误。
数据绑定不支持包含为合并元素的直接子元素
我遵循了android官方指南Android数据绑定。
我只是想摆脱上述布局文件的 findViewById 。
任何建议,将不胜感激。谢谢