小程序相关

1.右侧胶囊宽度,胶囊和文本重合问题

javascript 复制代码
// #ifdef MP-WEIXIN
// 获取胶囊左边界坐标
const { left } = uni.getMenuButtonBoundingClientRect()
this.rightSafeArea = left + 'px'
// #endif

//给到你的内容宽度
<view :style="{'max-width':rightSafeArea}">

2.在uview组件上修改样式不会生效,需要在外面套view

或者是在小程序开发工具中看下没有生效的view样式类名,用::v-deep写样式,h5和小程序用条件编译

3.顶部导航栏

顶部为搜索栏,可以获取胶囊信息设置

javascript 复制代码
const { height, top } = uni.getMenuButtonBoundingClientRect()
let statusBarHeight
uni.getSystemInfo({
	success: (e) => {
        statusBarHeight=e.statusBarHeight
    }
})
this.height= height + (top - statusBarHeight) * 2;

顶部为左侧返回按钮,中间为文本

javascript 复制代码
statusBar = e.statusBarHeight
const custom = wx.getMenuButtonBoundingClientRect()
customBar = custom.bottom + custom.top - e.statusBarHeight
//整个导航栏高度
:style="{'height':customBar+'px'}"
//标题内容
:style="{'line-height':statusBar+'px','margin-top':(customBar/2)+'px'}"

4.小程序底部占位

底部安全距离padding-bottom: env(safe-area-inset-bottom);

相关推荐
imperialeast12 小时前
WinAXP 2.4.0.830正式版
小程序·个人开发
CRMEB系统商城13 小时前
鲜花零售的预售与积分营销
开发语言·人工智能·科技·小程序·零售
镭封15 小时前
AI文字转语音能制作多人对白吗?角色分配操作指南
人工智能·小程序·音视频·语音识别·媒体
zhongben_keji15 小时前
批发商城APP怎么做:价格引擎、授信台账与资金合规的设计要点
ios·小程序·web app
2501_9159214318 小时前
iOS 实时日志怎么看?KeyMob 的日志过滤、崩溃报告与符号化
android·ios·小程序·https·uni-app·iphone·webview
小小王app小程序开发18 小时前
教育 AI 小程序玩法开发分析
人工智能·小程序
普通人62 天前
uniapp模版JS
开发语言·javascript·小程序·uni-app·1024程序员节
andrsted2 天前
企业培训时间难统一?练题簿让在线免费刷题与培训考核更好安排
学习·微信小程序·小程序·学习方法·刷题
李纲明2 天前
微信小程序 wx.uploadFile 上传失败:合法域名、临时路径与 HTTPS 证书排查
微信小程序·小程序·uploadfile·devdiy·上传失败
hnxaoli2 天前
win10小程序(二十四)批量新建文件夹
小程序