我按照 github 上的说明在我的应用程序中由 adamrocker 实现了 simple-side-drawer:
https://github.com/adamrocker/simple-side-drawer
我的应用程序中的代码:
//SLIDE
private SimpleSideDrawer mNav;
mNav = new SimpleSideDrawer(this);
mNav.setLeftBehindContentView(R.layout.activity_behind_left_simple);
findViewById(R.id.slidemenu).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mNav.toggleLeftDrawer();
}
});
这是“activity_behind_left_simple”的 xml
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/leftBehindMenuScroll"
android:background="@drawable/lavagna" >
<LinearLayout
style="@style/behindMenuScrollContent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:paddingTop="25dp" >
<TextView
android:id="@+id/ciao"
style="@style/behindMenuItemTitle"
android:gravity="center"
android:textStyle="italic"
android:layout_width="fill_parent"
android:text="General"
android:textColor="#000000" />
<Button
android:id="@+id/matrix"
android:background="@drawable/but_ok"
android:textColor="#ffffff"
style="@style/behindMenuItemLabel"
android:layout_width="203dp"
android:layout_height="40dp"
android:layout_marginTop="10dp"
android:gravity="center"
android:text="Rate"/>
简单的侧抽屉工作正常,但我想添加一个滚动效果。我怎样才能做到这一点?