【鸿蒙】《校园通》--校园生活模块

1.校园生活

从上一篇博客【鸿蒙】鸿蒙App应用-《校园通》开发步骤中,点击主页面中的校园生活,进入以下界面,如图一

                        图1

1.基本步骤

1.创建布局

在layout文件夹下创建布局文件,最外层布局添加背景图片,添加4个Text组件并进行右对齐的竖直居中显示,代码如下

<?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:background_element="$media:xiaoyuanshenghuo"
    ohos:alignment="vertical_center|right"
    ohos:orientation="vertical">

    <Text
        ohos:id="$+id:tv_xqpmt"
        ohos:height="match_content"
        ohos:widt

猜你喜欢

转载自blog.csdn.net/u010321564/article/details/119215306
今日推荐