我们现在开始先把侧滑栏做出来,再做底部。
1、侧滑菜单
我们上次已经把侧滑菜单的library引进来了,现在我们要去用这个东西。
我要用它的话,MainActivity 就不能继承Activity了,而是继承SlidingFragmentActivity
现在我们来分析一下
(1)其实setContentView(R.layout.activity_main);这句代码只是把activity_main.xml这个界面给呈现出来,了,这个也成为内容页,然后内容页有一个按钮点一下就出来一个东西,这个才是侧滑菜单。
(2)我们已经有setContentView了,然后呢我们也得把setBehindContentView也就是隐藏的侧滑菜单的View设计出来。
下面我们先来写一下这个侧滑菜单的布局menu.xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+i