【问题标题】:Collasping toolbar leave space at the bottom of layout android折叠工具栏在布局android的底部留下空间
【发布时间】:2016-03-08 11:45:16
【问题描述】:

`

<android.support.design.widget.CoordinatorLayout
    android:id="@+id/coordinator"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">

    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true"
        android:theme="@style/ThemeOverlay.AppCompat.Dark">


        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            app:titleTextAppearance="@style/ToolbarTitle"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"

            app:layout_scrollFlags="scroll|enterAlways">


            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text=""
                android:layout_gravity="start"
                android:textColor="@color/hedarcolor"
                android:textSize="18sp"
                android:gravity="center"
                android:id="@+id/toolbar_title" />

            <ImageView
                android:id="@+id/hederimage"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:layout_gravity="center"
                android:src="@drawable/frow_logo"/>

        </android.support.v7.widget.Toolbar>

        <FrameLayout
            android:id="@+id/containerView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="?attr/colorPrimary"
            app:tabGravity="fill">


            <View
                android:layout_width="match_parent"
                android:layout_height="3dp"
                android:background="@drawable/toolbar_dropshadow" />
        </FrameLayout>
    </android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>

<android.support.design.widget.NavigationView
    android:id="@+id/navigation_view"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    app:itemBackground="@drawable/drawer_list_selector"
    app:headerLayout="@layout/header"
    app:menu="@menu/drawer_menu"/>

I am animating toolbar on scroll usingRecycleview` 在 Android 中,它会在我的布局底部的图像中留下标记的空间。 试过了

  1. android:fitsSystemWindows="true" 到 Appbarlayout、折叠工具栏和 Cordinatelayout。

  2. supportRequestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY); 用于设置内容视图

这两个选项都不起作用。 帮我解决这个问题。

【问题讨论】:

  • 你得到答案了吗?

标签: android android-support-library android-recyclerview android-6.0-marshmallow android-support-design


【解决方案1】:
CoordinatorLayout= (CoordinatorLayout) v.findViewById(R.id.cl_my_account);
Display display = getActivity().getWindowManager().getDefaultDisplay();
CoordinatorLayout.setMinimumHeight(display.getHeight());

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-07-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-07-23
    • 1970-01-01
    相关资源
    最近更新 更多