话不多说直接看效果图和代码吧。
一、实现的效果图
二、工程结构目录
三、具体编码的实现
MainActivity的布局文件:activity_main.xml
其实很简单,左边四个按钮,右边部分用一个FrameLayout布局先把位置给占着,放Fragment
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<LinearLayout
android:id="@+id/ll"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@drawable/maintab_toolbar_bg"
android:orientation="vertical"
android:gravity="center_horizontal" >
<LinearLayout
android:id="@+id/ll_home"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/btn_selector"
android:gravity="center"
android:orientation="vertical" >
<ImageView
android:id="@+id/image_home"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/home_btn_selector" />
<TextView
android:id="@+id/text_home"
android:layout_width="wrap_content"
android:layout_height="wrap_co