当前位置:网站首页>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
边栏推荐
- MySQL数据库远程访问权限设置
- 【快应用】text组件里的文字很多,旁边的div样式会被拉伸如何解决
- 【TS】1368- 秒懂 TypeScript 泛型工具类型!
- 记录 AttributeError: ‘NoneType‘ object has no attribute ‘nextcall‘
- Kustomize使用手册
- K-d tree and octree of PCL
- Oracle 笔记
- JSP webshell free -- webshell free
- UVM learning - build a simple UVM verification platform
- Jsp webshell Free from killing - The Foundation of JSP
猜你喜欢
618再次霸榜的秘密何在?耐克最新财报给出答案
从.bag文件中读取并保存.jpg图片和.pcd点云
axis设备的rtsp setup头中的url不能带参
Special topic of binary tree -- acwing 47 Path with a certain value in binary tree (preorder traversal)
JVM之垃圾回收器
Kustomize user manual
二叉树专题--AcWing 1589. 构建二叉搜索树
Dialogue Wu Gang: why do I believe in the rise of "big country brands"?
JSP webshell free -- webshell free
对话吴纲:我为什么笃信“大国品牌”的崛起?
随机推荐
nodejs+express+mysql简单博客搭建
实验电镜距离测量之Matlab处理
Special topic of binary tree -- Logu p1229 traversal problem (the number of traversals in the middle order is calculated when the pre and post order traversals of the multiplication principle are know
Matlab processing of distance measurement of experimental electron microscope
JVM garbage collector
PCL 点云转深度图像
(五)APA场景搭建之挡位控制设置
转换YV12到RGB565图像转换,附YUV转RGB测试
[SUCTF2018]followme
Dialogue Wu Gang: why do I believe in the rise of "big country brands"?
PCL point cloud to depth image
13. Semaphore critical zone protection
QT学习日记8——资源文件添加
【TS】1368- 秒懂 TypeScript 泛型工具类型!
计算序列之和
JSP webshell free -- webshell free
二叉树专题--【深基16.例7】普通二叉树(简化版)(multiset 求前驱 后继 哨兵法)
二叉树专题--洛谷 P1229 遍历问题(乘法原理 已知前、后序遍历求中序遍历个数)
对话吴纲:我为什么笃信“大国品牌”的崛起?
洛谷 P4281 [AHOI2008]紧急集合 / 聚会(树上倍增 LCA)