Tôi có CoordinatorLayout
như mô tả trong blog: http://android-developers.blogspot.ru/2015/05/android-design-support-library.htmlLàm cách nào để hiển thị các phần tử đã thu gọn trong CoordinatorLayout theo chương trình?
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
...
app:layout_scrollFlags="scroll|enterAlways">
<TextView
...
app:layout_scrollFlags="scroll|enterAlways">
</android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>
Bên AppBarLayout
Tôi có Toolbar
và TextView
với thêm thông tin trạng thái. AppBarLayout
có thể bị thu gọn (sau khi cuộn). Đôi khi tôi cần hiển thị AppBarLayout
để hiển thị trạng thái đã thay đổi.
Làm cách nào để thực hiện chương trình?
này hoạt động hoàn hảo cho tôi. – Jigar
tại sao điều này không được chấp nhận làm câu trả lời? hoạt động hoàn hảo. – KunalK