Harmony应用开发--自定义标题栏实战

鸿蒙时代
发布于 2021-10-26 10:53
浏览
0收藏

在Harmony开发过程中,如果对系统标题栏感到不满意,可以进行自行修改设计。
配置文件(config.json)修改,在module下添加下面内容:
“module”: {

“metaData”:{
“customizeData”:[
{
“name”: “hwc-theme”,
“value”: “androidhwext:style/Theme.Emui.NoTitleBar”,
“extra”:“”
}
]
},

}
该内容是用于删除标题栏。
然后可以在页面中自定义标题栏,示例如下:
<div>
<div style=“display: flex;flex-direction: column;”>
<div style="
background-color: red;
height: 82px;
width: 100%;
align-items: flex-end;
“>
<text style=”
margin-left: 14px;
margin-bottom: 4px;
color: white;
font-size: 22px ;
">标题</text>
</div>
</div>
</div>
效果如图:
Harmony应用开发--自定义标题栏实战-鸿蒙开发者社区
完整代码地址:https://gitee.com/jltfcloudcn/jump_to/tree/master/MYstatus

分类
标签
Harmony应用开发--自定义标题栏实战.docx 24.99K 15次下载
1
收藏
回复
举报
回复
    相关推荐