滚动recyclelerview剪辑父视图时,如何解决该问题

时间:2016-07-27 05:28:26

标签: android android-recyclerview

当我使用cliptochild&时出现错误clipToPadding我的父视图是剪辑如何解决该问题如何在我使用recyclerview时解决该问题。

这是我的style.xml

 <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> 
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
        <item name="android:typeface">serif</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowAllowEnterTransitionOverlap">true</item>
        <item name="android:windowAllowReturnTransitionOverlap">true</item>
        <item name="android:windowContentTransitions">true</item>
        <item name="android:windowTranslucentNavigation">true</item>
        <item name="android:fitsSystemWindows">true</item>
        <item name="android:clipChildren">false</item>
        <item name="android:clipToPadding">false</item> 
    </style>

这是我的layout.xml

<LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="10dp"
            android:background="@drawable/fare_bg"
            >


        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="10dp"
            android:background="@drawable/fare_bg"
            >

            <LinearLayout
                android:id="@+id/address_bar_lin"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"

                android:orientation="horizontal"
                android:padding="5dp">

                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:padding="8dp"
                    app:srcCompat="@drawable/ub__fare_split_search_icon" />

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_weight="1"
                    android:orientation="vertical"
                    android:padding="2dp">

                    <EditText
                        android:id="@+id/placesEdittxt"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:background="@android:color/transparent"
                        android:singleLine="true"
                        android:textColor="@color/textAddressColor"
                        android:textSize="12sp"
                        android:typeface="monospace" />
                </LinearLayout>

                <ImageView
                    android:id="@+id/img_clear"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:padding="8dp"
                    android:visibility="gone"
                    app:srcCompat="@drawable/ub__x_normal" />
            </LinearLayout>
        </LinearLayout>


    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <android.support.v7.widget.RecyclerView
            android:id="@+id/recyclerview"
            android:layout_width="match_parent"
            android:fitsSystemWindows="false"
            android:layout_height="match_parent"
            android:layout_margin="10dp"
            android:layout_weight="1"
            android:background="@drawable/fare_bg"   >


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

    </RelativeLayout>

</LinearLayout>

enter image description here

1 个答案:

答案 0 :(得分:0)

从recyclerview中删除重量,因为父亲是相对布局并试试这个:

    var mySchema = new mongoose.Schema({
      timestamp_minute: Date,
      type: String,
      values: [ Number ]
    });