1.主界面选项卡搭建
从【鸿蒙】鸿蒙App应用-《记账软件》登录,注册,找回密码功能 登录成功之后,进入主界面。
这里我们先搭建主界面的布局结构,首先完成五个模块的选项卡的界面显示。
在layout文件夹下新建xml布局文件,使用垂直的现形布局摆放,分为三部分,头部标题,内容部分,选项卡部分。
<?xml version="1.0" encoding="utf-8"?>
<DirectionalLayout
xmlns:ohos="http://schemas.huawei.com/res/ohos"
ohos:height="match_parent"
ohos:width="match_parent"
ohos:orientation="vertical">
<!-- 标题部分 -->
<Text
ohos:id="$+id:tt"
ohos:height="match_content"
ohos:width="match_parent"
ohos:background_element="#FFDA44"
ohos:padding="10fp"
ohos:text="$string:app_name"
ohos:text_alignment="center