预制棒棒糖上的默认填充RecyclerView

时间:2015-10-06 06:50:17

标签: android padding android-recyclerview

我对某个活动有一个RecyclerView,其项目只有RelativeLayout而没有任何CardViewRecyclerView在运行api低于21的设备上有一些正确的填充。
项目和RecyclerView本身没有任何边距或填充,一切都只能在比21更高的情况下正常工作 如何删除红色箭头所示的填充?

enter image description here

编辑: 活动xml代码:

<android.support.design.widget.CoordinatorLayout 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/coordinatorLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="ir.peykebartar.android.activity.SearchActivity">

<android.support.design.widget.AppBarLayout
    android:id="@+id/appBar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <include
        android:id="@+id/toolbar"
        layout="@layout/toolbar_search_activity" />

</android.support.design.widget.AppBarLayout>

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior">



        <android.support.v7.widget.RecyclerView
            android:id="@+id/resultList"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#567"
            android:layout_above="@id/listFooterContainer"
            android:scrollbars="none" />

        <ir.peykebartar.android.view.CustomTextView
            android:id="@+id/error"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:padding="@dimen/padding_large"
            android:text="@string/load_error"
            android:textColor="@color/text_primary"
            android:visibility="gone" />

</RelativeLayout>

<!-- FAB -->
<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="56dp"
        android:layout_height="56dp"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_marginBottom="@dimen/floatActionButton_marginBottom"
        android:layout_marginLeft="16dp"
        android:src="@drawable/ic_plus"
        app:backgroundTint="#9A12B3"
        app:fabSize="normal" />
</RelativeLayout>

RecyclerView项目xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/swipeLayoutParent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<ir.peykebartar.android.view.CustomSwipeLayout
    android:id="@+id/swipeLayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
    <!-- Bottom View Start-->
    <LinearLayout
        android:background="@null"
        android:id="@+id/bottom_wrapper"
        android:layout_width="150dp"
        android:layout_height="match_parent">

        .
        .
        .

    </LinearLayout>
    <!-- Bottom View End-->

    <!-- Surface View Start -->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="100dp"
        android:background="@color/white">

        .
        .
        .

    </LinearLayout>

</ir.peykebartar.android.view.CustomSwipeLayout>

</LinearLayout>

0 个答案:

没有答案