Dezo
Dezo

Reputation: 871

Can anyone explain me about "app:layout_behavior="@string/appbar_scrolling_view_behavior"?

Can anyone explain me about this property "app:layout_behavior="@string/appbar_scrolling_view_behavior"?

Upvotes: 4

Views: 6767

Answers (2)

Jeisson Valderrama
Jeisson Valderrama

Reputation: 109

Change android.support.constraint.ConstraintLayout ✖ to android.support.design.widget.CoordinatorLayout ✓ then the child elements can use app:layout_behavior

Upvotes: 2

user221256
user221256

Reputation: 435

If you use CoordinatorLayout you can use layout behaviors such as hiding FloatingActionButton while scrolling list or hide toolbar while scrolling list. The behaviour you are asking about is used for the 2nd case, where this behaviour should be set on view which triggers toolbar scrolling. This string resource contains class name which defines the behaviour. You can create custom behaviours as well.

Upvotes: 1

Related Questions