uniapp app头部渐变

摘要:
在页面上json格式的配置:{“pages”:[//pages数组中的第一项表示应用程序启动页面,{“path”:“pages/login/login”,“style”:{”navigationBarTitleText“:”login“,”navigationBarBackgroundColor“:”#ffffff“,”app plus“:{”titleNView“:false,”type“:”transpa
在pages.json中配置:

{ "pages": [ //pages数组中第一项表示应用启动页, { "path": "pages/login/login", "style": { "navigationBarTitleText": "登录", "navigationBarBackgroundColor": "#ffffff", "app-plus": { "titleNView": false, "type": "transparent" //透明渐变导航栏 App-nvue 2.4.4+ 支持 } } }, // #ifdef APP-PLUS || MP-WEIXIN { "path": "pages/station/detail", "style": { "navigationBarTitleText": "电站详情", "app-plus": { "titleNView": { "backgroundImage": "linear-gradient(to top, #abc837, #4fa23c)" } }, "enablePullDownRefresh": true, //设置为true表示当前页面开启下拉刷新 "backgroundTextStyle": "dark" //下拉 loading 的样式,仅支持 dark/light // , // "app-plus": { // "titleNView": { // "titleText": "", // "tags": [{ // "tag": "img", // "src": "/static/img/sta/bja.png", // "position": { // "right": "10px", // "top": "auto", // "width": "26px", // "height": "26px" // } // }], // "buttons": [ //原生标题栏按钮配置, // { // "type": "none", // "text": "", // "float": "right" // } // ] // } // } } }, // #endif ], "tabBar": { "color": "#7a7e83", "selectedColor": "#42b727", "backgroundColor": "#ffffff", "list": [{ "pagePath": "pages/main/main", "text": "首页", "iconPath": "static/img/icon-index_n.png", "selectedIconPath": "static/img/icon-index_s.png" }, { "pagePath": "pages/station/station", "text": "电站", "iconPath": "static/img/icon-dz_n.png", "selectedIconPath": "static/img/icon-dz_s.png" }, { "pagePath": "pages/alarm/alarm", "text": "故障", "iconPath": "static/img/icon-gj_n.png", "selectedIconPath": "static/img/icon-gj_s.png" }, { "pagePath": "pages/user-center/user-center", "text": "个人", "iconPath": "static/img/icon-ren_n.png", "selectedIconPath": "static/img/icon-ren_s.png" } ] }, "globalStyle": { "navigationBarTextStyle": "white", "navigationBarBackgroundColor": "#4fa23c", "backgroundColor": "#fbf9fe" } }

特别注意:需要用

// #ifdef APP-PLUS || MP-WEIXIN

// #endif
包裹在路由头部和尾部生成app才有效果
在"app-plus":对象中添加属性设置:
"titleNView": {
   "backgroundImage": "linear-gradient(to top, #abc837, #4fa23c)"
}

展示一下实际效果:

uniapp app头部渐变第1张

免责声明:文章转载自《uniapp app头部渐变》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇WPF图表库Live Chartsword文档标题级别批量更改——批量降级与升级实例下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

WIN10 使用POWERSHELL 设置单应用KIOSK模式(win10家庭版或企业版)

win10 使用PowerShell 设置单应用kiosk模式 win10 家版或企业版PowerShellshell 启动器 v1Autologon.exe 注意事项 win10 家庭版或企业版。 下载安装Autologon.exe。 Shell 启动器 v1调用的应用程序不可有黑窗(类似cmd)。 以下示例采用账号:- 账户:'KIOSK'- 密码:'...

常用 adb 命令总结

1. 显示当前运行的全部模拟器: adb devices2. 安装应用程序: adb install -r 应用程序.apk3. 获取模拟器中的文件: adb pull <remote> <local>4. 向模拟器中写文件: adb push <local> <remote>5. 进入模拟器的shell模式...

ios真机调试时需要添加的UDID是什么?怎么获取?

很多开发者在真机调试测试ios应用时,会看到需要添加udid,搞不清这个是什么东西应该怎么获取。 udid就是手机的一个串号,相当于手机的身份证,具有唯一性。 下面介绍如何获取udid并添加到开发者中心后台。 有两种方式可以获取udid ios app真机调试到上架App Store完整教程 1、苹果手机助手获取UDID 如爱思助手,电脑下载爱思助手...

为什么每个浏览器User-Agent都是Mozilla?真相原来是这样!

转载自简明现代魔法http://www.nowamagic.net/librarys/veda/detail/2576 故事还得从头说起,最初的主角叫NCSA Mosaic,简称Mosaic(马赛克),是1992年末位于伊利诺伊大学厄巴纳-香槟分校的国家超级计算机应用中心(National Center for Supercomputing Applica...

Activity简介

Activities简介         Activity类是android应用程序中的一个重要组件,activity对象组织和启动的方式更是android平台应用程序模型的基础。与范式编程使用main()函数启动应用不同,android系统在Activity实列中通过调用符合当前Activity生命周期的回调方法来执行代码。       本文档介绍act...

高分屏显示模糊修复工具

高分屏显示模糊修复工具下载 此现象是由于系统自带的放大功能导致,由于笔记本屏幕较小,高分屏会出现图标、应用等整体显示比较小的情况,所以系统会默认设置为150%的放大显示,如果部分应用的显示界面分辨率不高,放大后就会模糊,这是正常的现象,笔记本高分屏使用windows系统都会有类似情况。 可使用以下工具调整缩放比例为100%或125%或者禁用软件的DPI缩放...