当前位置:网站首页>One trick to quickly realize custom application titlebar
One trick to quickly realize custom application titlebar
2022-07-02 11:00:00 【Huawei Developer Forum】
background
Fast application system comes with titleBar The default is on the left , And it cannot be customized , The requirements encountered by developers in the development process are displayed in the middle of the top , Not on the left . This article aims to help developers realize customization titleBar.
Implementation steps
Customize titleBar The implementation is divided into two steps .
1、manifest.json Set in file as titleBar Property is set to false, Hide the system's own titeBar.
"display": {
"titleBar": false,
"pages": {
"Hello": {
"statusBarBackgroundColor": "#0faeff"
}
}
}2、 Implement customization titleBar, Use one text Components , And make it display in the center .
<template>
<!-- Only one root node is allowed in template. -->
<div class="container">
<text class="txt">titlebar</text>
<div class="label">
<text style="font-size: 60px">this is test page</text>
</div>
</div>
</template>
<style>
.container {
flex-direction: column;
align-items: center;
}
.txt {
font-size: 60px;
color: #00ced1;
margin-top: 15px;
}
.label {
flex-direction: column;
justify-content: center;
width: 100%;
height: 100%;
}
</style>
<script>
module.exports = {
data: {
status: 1
},
onInit() {
},
onShow(options) {
'// Do something when show.'
},
}
</script>design sketch :

For more details , See quick apply manifest The file is introduced :
https://developer.huawei.com/consumer/cn/doc/development/quickApp-Guides/quickapp-develop-deeplink
边栏推荐
- 二叉树专题--AcWing 18. 重建二叉树(利用前、中序遍历,构建二叉树)
- [SUCTF2018]followme
- Dialogue Wu Gang: why do I believe in the rise of "big country brands"?
- 二叉树专题--洛谷 P3884 [JLOI2009]二叉树问题(dfs求二叉树深度 bfs求二叉树宽度 dijkstra求最短路)
- UVM——Callback
- 华为游戏初始化init失败,返回错误码907135000
- JVM garbage collector
- 【AGC】构建服务3-认证服务示例
- 首份中国企业敏捷实践白皮书发布| 附完整下载
- 一招快速实现自定义快应用titlebar
猜你喜欢
随机推荐
Sus system availability scale
使用sqlcipher打开加密的sqlite方法
nodejs+express+mysql简单博客搭建
华为游戏初始化init失败,返回错误码907135000
(5) Gear control setting of APA scene construction
实验电镜距离测量之Matlab处理
14. Code implementation of semaphore
PCL 点云转深度图像
洛谷 P1892 [BOI2003]团伙(并查集变种 反集)
Leetcode+ 76 - 80 storm search topic
MongoDB 学习整理(条件操作符,$type 操作符,limit()方法,skip() 方法 和 sort() 方法)
Shell programming 01_ Shell foundation
P1055 [noip2008 popularization group] ISBN number
计算序列之和
Win11 arm系统配置.net core环境变量
二叉树专题--AcWing 3540. 二叉搜索树建树(实用板子 构建二叉搜索树 并输出前、中、后序遍历)
618 what is the secret of dominating the list again? Nike's latest financial report gives the answer
1287_ Implementation analysis of prvtaskistasksuspended() interface in FreeRTOS
V2X-Sim数据集(上海交大&纽约大学)
【深入浅出玩转FPGA学习2----设计技巧(基本语法)】



![[AI application] Hikvision ivms-4200 software installation](/img/4e/1640e3cafac13ce4d39520195c3217.png)




![[SUCTF2018]followme](/img/63/9104f9c8bd24937b0fc65053efec96.png)
