Android 上拉滑动上滑拖出pop 类似百度地图抽屉拖拽效果

这里我们用到GitHub上个一个开源库:https://github.com/yingLanNull/ScrollLayout

先看效果图


大概就是这样的一个效果,这个库功能非常多,感谢前辈们的贡献!

--------------------------------------手动分割----------------------------------------------------------------.

首先添加依赖

compile 'com.yinglan.scrolllayout:scrolllayout:1.0.2'

开始写布局,我这个布局就一个Button其他的都是这个控件所需要的

activity.xml

<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/root"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <com.yinglan.scrolllayout.ScrollLayout
        android:id="@+id/scroll_down_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#000000"
        >

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

            <com.yinglan.scrolllayout.content.ContentListView
                android:id="@+id/list_view"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@android:color/white"
                ></com.yinglan.scrolllayout.content.ContentListView>

            <TextView
                android:id="@+id/text_foot"
                android:layout_width="match_parent"
                android:layout_height="50dp"
                android:background="@color/colorPrimaryDark"
                android:clickable="true"
                android:gravity="center"
                android:text="点击或上滑打开" />
        </RelativeLayout>
    </com.yinglan.scrolllayout.ScrollLayout>

    <Button
        android:id="@+id/test_bt"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="测试按钮"
        />

</RelativeLayout>

  • 0
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值