Tôi muốn thanh công cụ (thanh tác vụ) ẩn hoàn toàn khi cuộn xuống. Khi khởi chạy hoạt động hoặc cuộn lại thanh công cụ sẽ hiển thị và thanh trạng thái sáng màu xám.Thanh công cụ sẽ không cuộn dưới thanh trạng thái trong suốt
- bắt đầu bằng [statusbar | thanh công cụ | content]
- cuộn xuống [co- (thanh trạng thái) -ntent]
- cuộn lên [thanh trạng thái | thanh công cụ | nội dung]
:
activity_layout.xml
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background_white"
tools:context="com.conevoud.captjeluigi.ui.activities.GalleryActivity">
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<include layout="@layout/toolbar" />
</android.support.design.widget.CoordinatorLayout>
<include layout="@layout/drawer_left" />
</android.support.v4.widget.DrawerLayout>
toolbar.xml
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.design.widget.AppBarLayout
android:id="@+id/toolbar_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="?popup_theme"
app:theme="@style/ThemeOverlay.AppCompat.ActionBar" />
</android.support.design.widget.AppBarLayout>
</merge>
phong cách:
<item name="windowActionModeOverlay">true</item>
<item name="android:windowTranslucentNavigation">true</item>
<item name="android:windowTranslucentStatus">true</item>
cảm ơn bạn đã đọc.
Bất kỳ may mắn sửa chữa này? – SqueezyMo
Tôi tìm thấy giải pháp, ai đó vẫn muốn biết? – ThirdMartian
có, vui lòng. @ThirdMartian –