HarmonyOS Next实现仿微信程序界面
本文将详细介绍如何在HarmonyOS Next平台上实现一个仿微信的程序界面,包括主界面布局、底部导航栏、聊天界面和联系人界面的设计与实现。
一、项目结构设计
WeChatClone/
├── entry/src/main/
│ ├── ets/
│ │ ├── pages/
│ │ │ ├── MainAbilityPage.ets
│ │ │ ├── ChatPage.ets
│ │ │ ├── ContactsPage.ets
│ │ │ ├── DiscoverPage.ets
│ │ │ ├── MePage.ets
│ │ ├── components/
│ │ │ ├── BottomNavigationBar.ets
│ │ │ ├── ChatListItem.ets
│ │ │ ├── ContactItem.ets
│ │ ├── utils/
│ │ │ ├── Constants.ets
│ │ │ ├── DataUtils.ets
│ │ ├── app.ets
│ └── ets_main/
└── build-profile.json
二、基础配置
1. 配置页面路由
在entry/src/main/resources/base/profile/ability_main.xml
中配置页面路由: