Reputation: 29
Any advice why I'm getting this error on layout_behavior, and how to fix it?
Upvotes: 4
Views: 9521
Reputation: 4257
For Androidx I followed this and got problem solved.
summary: In Gradle:
implementation 'com.google.android.material:material:1.1.0-alpha05'
in XML:
app:layout_behavior="@string/appbar_scrolling_view_behavior"
If not solved then Invalidate caches / Restart
Upvotes: 1
Reputation: 109
It is possible that you have a different label than this: android.support.design.widget.CoordinatorLayout
maybe you have 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"
Upvotes: 2
Reputation: 6579
layout_behavior
attribute is part of the CoordinatorLayout
. It defines interaction behavior plugin for child views of 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
withCoordinatorLayout
if you need behavior functionality.
Upvotes: 0