android - coordinatorLayout嵌套recyclerview
本文介绍了android - coordinatorLayout嵌套recyclerview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
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:background="@color/bg_grey"
android:clickable="true">
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<android.support.design.widget.AppBarLayout
android:background="@null"
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<RelativeLayout
app:contentScrim="#30469b"
app:expandedTitleMarginStart="0dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<TextView
android:id="@+id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:layout_marginBottom="8dp"
android:layout_marginTop="10dp"
android:text="室内门禁终端"
android:textColor="#2196F3"
/>
<LinearLayout
android:id="@+id/family_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/text1"
android:layout_marginBottom="8dp"
android:layout_marginRight="13dp"
android:layout_marginTop="2dp"
android:orientation="vertical"/>
<TextView
android:id="@+id/text2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/family_list"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="8dp"
android:layout_marginTop="10dp"
android:text="联系人"
android:textColor="#2196F3"
/>
</RelativeLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/contact_ev"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="13dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
</android.support.design.widget.CoordinatorLayout>
<com.jingxi.smartlife.user.widget.ZSideBar
android:id="@+id/contact_sidebar"
android:layout_width="15dp"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:layout_gravity="right"
android:layout_marginRight="3dp"/>
</RelativeLayout>
这是我的布局
现在问题是ZSideBar是一个自定义字母控件 这是个联系人列表
现在的问题是点击ZSideBar的时候没有滚动正确 比如我点击的是Z但是没有滚动到Z的位置
大神们这是什么问题
解决方案
我都改成用一个reclerview就没有这个问题了
这篇关于android - coordinatorLayout嵌套recyclerview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文