基础
类似于DrawerLayout,侧滑控件。但只支持往右滑,不支持往左滑。一般常用做为布局的根节点,第一个子view为菜单项(即滑动后才可见),第二个子view为内容项。
它继承于ViewGroup,但最多只有两个子view,虽然多个子View不报错。如下:
if (childCount > 2) {//onMeasure()方法中
Log.e(TAG, "onMeasure: More than two child views are not supported.");
}
基本使用
在布局中如下:
<android.support.v4.widget.SlidingPaneLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="80dp">
<TextView
android:gravity="right"
android:background="#00ff00"
android