欢迎来到人人都可写代码,大家好,我是杨晓华,今天我们的课程内容是项目实操,以智者精选项目为例,编写一个Android app的入口关联菜单栏逻辑。
这是要实现的菜单栏组件展示效果,下面就是教大家如何制作的步骤:
![51cdf105acaf48d744ee1dedfb745e79.png](https://img-blog.csdnimg.cn/img_convert/51cdf105acaf48d744ee1dedfb745e79.png)
- APP的菜单栏是把一级页面Frame组合起来,并实现各个Frame之间交互的切换跳转。首先创建菜单栏的布局文件activity_main.xml,然后创建入口文件MainActivity,最后在MainActivity中关联各个Frame文件和实现Frame之间的切换跳转逻辑。
2、activity_main.xml布局文件编写的代码是:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/white" android:orientation="vertica