Android Studio layout_behavior error

Viewed 9201

Any advice why I'm getting this error on layout_behavior, and how to fix it?

enter image description here

3 Answers

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"

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

Related