uniapp 微信小程序遇到的坑

一、使用自定义tabbar,tabbar列表页面使用原生下拉刷新

**问题:**在开发微信小程序 使用自定义tabbar,tabbar列表页面使用原生下拉刷新 模拟机是没问题的,在安卓端真机调试会遇到下拉刷新时tabbar也会跟着下拉出页面 ,回弹后显示正常

解决方案: 使用scroll-view嵌套模式,可滚动视图区域。使用竖向滚动,需要给scroll-view一个固定高度

skyline 渲染模式下,当存在两个 scroll-view 相互嵌套的场景时,两者的滚动不能很丝滑的进行衔接,故可将外层 scroll-view 改成嵌套模式,这样可以让两个 scroll-view 的滚动衔接起来。

javascript 复制代码
<!-- 外层 scroll-view -->
<scroll-view
  type="nested"
  scroll-y
  refresher-enabled="{{true}}"
>
  <view slot="refresher">自定义 refresher</view>
  <nested-scroll-header><view>外层 scroll-vew 的节点 1</view></nested-scroll-header>
  <nested-scroll-header><view>外层 scroll-vew 的节点 2</view></nested-scroll-header>
  <nested-scroll-body>
    <swiper>
      <swiper-item>
        <!-- 里层 scroll-view -->
        <scroll-view type="list" associative-container="nested-scroll-view">
          <view>里层 scroll-vew 的节点 1</view>
          <view>里层 scroll-vew 的节点 2</view>
        </scroll-view>
      </swiper-item>
      <swiper-item></swiper-item>
      <swiper-item></swiper-item>
    </swiper>
  </nested-scroll-body>
</scroll-view>

二、页面使用scroll-view标签页面高度设置100vh,页面输入框内容会发生上移

**问题:**页面使用scroll-view标签页面高度设置100vh,页面输入框内容会发生上移

**解决方案:**1、页面高度设置为100%

2、使用calc样式

javascript 复制代码
	.scroll-view-hight {
		height: calc(100vh + 1px);
	}

三、微信小程序使用vant下拉菜单在页面中间非遮罩层部分可滚动

**解决方案:**1、使用变量状态控制页面是否可滚动,禁用滚动条

2、使用顶部弹出层,禁用遮罩层事件

相关推荐
一只程序熊几秒前
uniapp 通过通道$on或者$once调用函数内的showModal弹窗,但是没有反应
uni-app
一渊之隔2 分钟前
uniapp封装 SQLite数据库操作接口
数据库·uni-app
qq_12498707537 分钟前
基于springboot的个性化服装搭配推荐小程序(源码+论文+部署+安装)
spring boot·后端·spring·微信小程序·小程序·毕业设计·毕业设计源码
天蓝色的鱼鱼1 天前
从“死了么”到“我在”:用uniCloud开发一款温暖人心的App
前端·uni-app
小徐_23331 天前
uni-app 组件库 Wot UI 的 AI 友好型编程指南
前端·uni-app
CHB2 天前
uni-app x 蒸汽模式 性能测试基准报告 Benchmark
uni-app·harmonyos
whinc2 天前
🚀 两年小程序开发,我把踩过的坑做成了开源 Skills
前端·微信小程序·ai编程
Lupino2 天前
烧掉 10 刀 API 费,我才明白小程序虚拟列表根本不用“库”!
react.js·微信小程序
anyup2 天前
月销 8000+,uView Pro 让 uni-app 跨端开发提速 10 倍
前端·uni-app·开源
小溪彼岸3 天前
是时候给想做小程序的小伙伴泼盆冷水了
微信小程序