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

 

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

先看效果图

 

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

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

首先添加依赖

 

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

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

activity.xml

 
  1. <RelativeLayout

  2. xmlns:android="http://schemas.android.com/apk/res/android"

  3. xmlns:tools="http://schemas.android.com/tools"

  4. android:id="@+id/root"

  5. android:layout_width="match_parent"

  6. android:layout_height="match_parent"

  7. tools:context=".MainActivity">

  8.  
  9. <com.yinglan.scrolllayout.ScrollLayout

  10. android:id="@+id/scroll_down_layout"

  11. android:layout_width="match_parent"

  12. android:layout_height="match_parent"

  13. android:background="#000000"

  14. >

  15.  
  16.  
  17. <RelativeLayout

  18. android:layout_width="match_parent"

  19. android:layout_height="match_parent">

  20.  
  21. <com.yinglan.scrolllayout.content.ContentListView

  22. android:id="@+id/list_view"

  23. android:layout_width="match_parent"

  24. android:layout_height="match_parent"

  25. android:background="@android:color/white"

  26. ></com.yinglan.scrolllayout.content.ContentListView>

  27.  
  28. <TextView

  29. android:id="@+id/text_foot"

  30. android:layout_width="match_parent"

  31. android:layout_height="50dp"

  32. android:background="@color/colorPrimaryDark"

  33. android:clickable="true"

  34. android:gravity="center"

  35. android:text="点击或上滑打开" />

  36. </RelativeLayout>

  37. </com.yinglan.scrolllayout.ScrollLayout>

  38.  
  39. <Button

  40. android:id="@+id/test_bt"

  41. android:layout_width="wrap_content"

  42. android:layout_height="wrap_content"

  43. android:text="测试按钮"

  44. />

  45.  
  46. </RelativeLayout>

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值