嵊州建设银行取款网站,做kegg通路富集的网站,中国十大地推公司,浙江省台州市做网站多少钱导航栏自定义加需要吸顶产生的问题 如上图直接使用并不能出现tab栏吸顶效果#xff0c;那是由于u-sticky组件吸顶时与顶部的距离默认为0
那么做如下处理
u-sticky :offset-topnavbarHeight()u-tabs :listhelpTabList active-color那是由于u-sticky组件吸顶时与顶部的距离默认为0
那么做如下处理
u-sticky :offset-topnavbarHeight()u-tabs :listhelpTabList active-color#D01F25 :currenthelpTabCurrentchangehelpChange/u-tabs
/u-sticky // 参考uview导航栏的高度用来设定吸顶时与顶部的距离,h5不需要操作navbarHeight() {let systemInfo uni.getSystemInfoSync();/* (750 / systemInfo.windowWidth) *//* 在uview navBar组件中有一个默认高度当这个默认高度加上状态栏高度后就是吸顶的位置由于这两者相加是px所以最后还需要转为rpx */let topHeight0// #ifdef APP-PLUStopHeight 44 systemInfo.statusBarHeight;// #endif// #ifdef MPlet height systemInfo.platform ios ? 44 : 48;topHeight height systemInfo.statusBarHeight// #endif/* 最后一步将px转为rpx */return topHeight * (750 / systemInfo.windowWidth)},
经过上述处理就可以出现吸顶效果了