明白了!最简单。没有图书馆,没有复杂的代码。使用SimplePaneLayout。
只需将android:layout_marginLeft设置为合适的值即可。 :) :)真棒
<android.support.v4.widget.SlidingPaneLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/slidingpanelayout">
<LinearLayout android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#CCC"
android:orientation="horizontal"
android:id="@+id/fragment_firstpane"/>
<LinearLayout android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000"
android:orientation="horizontal"
android:layout_marginLeft="40dp"
android:id="@+id/fragment_secondpane"/>
</android.support.v4.widget.SlidingPaneLayout>
你试过Viewpager:http://developer.android.com/training/animation/screen-slide.html – vjdhama
感谢@vjdhama,我会尝试这一点,并让你知道。 –
你怎么样看着一些滑动菜单库? [链接](https://github.com/jfeinstein10/SlidingMenu)等 – momoja