Android Studio显示警告:此处不允许元素合并 [英] Android Studio shows warning: Element merge is not allowed here
问题描述
我基于LinearLayout创建自定义视图.该类扩展了LinearLayout类,在布局中我拥有:
I create custom view based on LinearLayout. Class extends the LinearLayout class, in layout I have:
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<merge>
some staff here
</merge>
</layout>
Android Studio显示警告Element merge is not allowed here
,但该应用程序可以运行.
Android Studio shows the the warning Element merge is not allowed here
, but app works.
怎么了?
推荐答案
我认为这只是Android Studio中的一个小故障.甚至官方文档也将merge
作为layout
的直接子代: https://developer.android.com/topic/libraries/data-binding/index.html
I believe it's just a glitch in Android studio. Even the official documentation has merge
as a direct child of layout
: https://developer.android.com/topic/libraries/data-binding/index.html
I filed a bug there: https://code.google.com/p/android/issues/detail?id=286406&thanks=286406&ts=1490873944
Edit2:错误已在AS 3.5 Canary 12中固定为\ o/
Bug is fixed \o/ in AS 3.5 Canary 12
这篇关于Android Studio显示警告:此处不允许元素合并的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!