这里我们用到GitHub上个一个开源库:https://github.com/yingLanNull/ScrollLayout
先看效果图
大概就是这样的一个效果,这个库功能非常多,感谢前辈们的贡献!
--------------------------------------手动分割----------------------------------------------------------------.
首先添加依赖
compile 'com.yinglan.scrolllayout:scrolllayout:1.0.2'
开始写布局,我这个布局就一个Button其他的都是这个控件所需要的
activity.xml
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">