[英]Android Studio layout_behavior error
It is possible that you have a different label than this: android.support.design.widget.CoordinatorLayout
您可能有与此不同的标签: android.support.design.widget.CoordinatorLayout
maybe you have android.support.constraint.ConstraintLayout
.也许你有android.support.constraint.ConstraintLayout
。
If so, you should change it to android.support.design.widget.CoordinatorLayout , since the child elements can apply the attribute app:layout_behavior="@string/appbar_scrolling_view_behavior"
如果是这样,您应该将其更改为android.support.design.widget.CoordinatorLayout ,因为子元素可以应用属性app:layout_behavior="@string/appbar_scrolling_view_behavior"
For Androidx I followed this and got problem solved.对于 Androidx,我遵循了这个并解决了问题。
summary: In Gradle:摘要:在 Gradle 中:
implementation 'com.google.android.material:material:1.1.0-alpha05'
in XML:在 XML 中:
app:layout_behavior="@string/appbar_scrolling_view_behavior"
If not solved then Invalidate caches / Restart如果未解决,则使缓存无效/重新启动
layout_behavior
attribute is part of the CoordinatorLayout
. layout_behavior
属性是CoordinatorLayout
一部分。 It defines interaction behavior plugin for child views of CoordinatorLayout.它为 CoordinatorLayout 的子视图定义了交互行为插件。
In your case you can either delete this attribute ( app:layout_behavior="@string/appbar_scrolling_view_behavior"
) from your code or wrap your RelativeLayout
with CoordinatorLayout
if you need behavior functionality.在您的情况下,您可以从代码中删除此属性( app:layout_behavior="@string/appbar_scrolling_view_behavior"
),或者如果您需要行为功能,则使用CoordinatorLayout
包装您的RelativeLayout
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.