举头望明月
举头望明月
  • 发布:2019-03-29 15:20
  • 更新:2020-02-04 21:57
  • 阅读:14656

【报Bug】css样式变量 var(--status-bar-height)、var(--window-top)、var(--window-bottom),在5+app上不生效。

分类:uni-app

css样式变量 var(--status-bar-height)、var(--window-top)、var(--window-bottom),在5+app上不生效。
项目需要跨端适配H5和app,使用css变量的话,只有H5生效,目前只测试了安卓手机,没有测试过iPhone。暂时只能使用条件编译来做了。

style标签
<style lang="scss" scoped>

.card-center {
width: 100vw;
height: calc(100vh - var(--window-bottom));

&-top {  
    position: absolute;  
    top: 0;  
    left: 0;  
    width: 100%;  
    height: 70upx;  
}  

&-swipe {  
    position: absolute;  
    top: 70upx;  
    width: 100%;  
    height: calc(100vh - 70upx - var(--window-bottom));  
}  

}
</style>

2019-03-29 15:20 负责人:无 分享
已邀请:
9***@qq.com

9***@qq.com - the world is built with code

使用这些 变量需要在项目引入uni.css吗??

DCloud_UNI_GSQ

DCloud_UNI_GSQ

已修复,更新到 HBuilderX alpha 2.0.2 即可

该问题目前已经被锁定, 无法添加新回复