android - coordinatorLayout嵌套recyclerview
PHP中文网
PHP中文网 2017-04-17 17:55:55
0
2
499

<?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的位置 



大神们这是什么问题

PHP中文网
PHP中文网

认证高级PHP讲师

Antworte allen(2)
阿神

我都改成用一个reclerview就没有这个问题了

黄舟

楼主暴力膜蛤不可取

Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!