集成步骤:
1.新建一个Android studio工程:
2.添加依赖
compile 'com.ikimuhendis:ldrawer:0.1'
3.编写activity_main.xml文件
<android.support.v4.widget.DrawerLayout
android:id="@+id/drawer_layout"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
// 主界面的布局
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="Android drawer icon with material design animation"/>
</RelativeLayout>
//抽屉界面的布局
<!-- The navigation drawer -->
<ListView
android:id="@+id/navdrawer"
android:layout_width="260dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="@android:color/white"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:drawSelectorOnTop="false">
</ListView>
</android.support.v4.widget.DrawerLayout>
4.编写MainActivity.class代码
public class MainActivity extends Activity {
private DrawerLayout mDrawerLayout;