uniapp初识笔记3

2一、iphone x 底部固定按钮适配html

主要就是安全区的兼容。
1、mainfest.json 文件 app-plus 节点下配下 safearea

"safearea": {  
    "bottom": {  
        "offset": "none"  
    }  
}
2、添加安全区元素
.safe-reg {
    padding-bottom: constant(safe-area-inset-bottom);
    padding-bottom: env(safe-area-inset-bottom);
}
如:
<view class="footer-region footer-region-fixed">
                <view class="click-reg">
                    <text>我已阅读并赞成该协议</text>
                </view>
                <view class="safe-reg"></view>
            </view> 

https://ask.dcloud.net.cn/article/35564

2二、1px 适配问题
ui说 默认的1px 过宽;ios

.border-b:after {

  position: absolute;

  content: '';

  width: 100%;

  left: 0;

  bottom: 0;

  height: 1px;

  background-color: #e3e5e9;

  -webkit-transform: scale(1, 0.5);

  transform: scale(1, 0.5);

  -webkit-transform-origin: center bottom;

  transform-origin: center bottom;

}


2三、picker组件 修改样式
微信小程序暂不支持修改。只能使用 picker-view
https://ext.dcloud.net.cn/plugin?id=273

2四、swiper组件滑动圆角;
ios上是直角,须要的是圆角。
解决;
外层套一个view,设置样式
border-radius: 10rpx;
transform: translateY(0);
overflow:hidden;  /* 让照片循环的时候不变成直角 */

2五、web-view
web-view 是一个 web 浏览器组件,能够用来承载网页的容器,会自动铺满整个页面。
https://www.cnblogs.com/Glant/p/11217270.html

2六、ios bug
场景:
两个tab页面,这里叫首页与我的中心。用到了 store的state属性。经过 state的 hasLogin 来同时控制 俩页的 元素显示。当在首页 改变 hasLogin值时,首页 显示正常;我的中心页 也获得了通知,但出现 本地静态图片 未加载的bug。我的中心页,操做改变时,此bug在首页出现。

解决方式:
经过import 导入这些静态图片,而后 绑定到image标签。

2七、image 经常使用样式
设定宽度,高度自动,不变形
 mode="widthFix" style="width: 100%;"web

相关文章
相关标签/搜索