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、使用顶部弹出层,禁用遮罩层事件

相关推荐
狂团商城小师妹4 小时前
XYlease租赁商城小程序
微信·微信小程序·小程序
2501_915909065 小时前
“绑定 HTTPS” 的工程全流程 从证书配置到真机验证与故障排查
网络协议·http·ios·小程序·https·uni-app·iphone
2501_915918416 小时前
iOS 混淆实战 多工具组合完成 IPA 混淆、加固与工程化落地(iOS混淆|IPA加固|无源码混淆|Ipa Guard|Swift Shield)
android·ios·小程序·https·uni-app·iphone·webview
游戏开发爱好者88 小时前
如何系统化掌握 iOS 26 App 耗电管理,多工具协作
android·macos·ios·小程序·uni-app·cocoa·iphone
BumBle10 小时前
uniapp AI聊天应用技术解析:实现流畅的Streaming聊天体验(基础版本)
前端·uni-app
2501_9159214310 小时前
运营日志驱动,在 iOS 26 上掌握 App 日志管理实践
android·macos·ios·小程序·uni-app·cocoa·iphone
顾青12 小时前
微信小程序 VisionKit 实战(二):静态图片人脸检测与人像区域提取
前端·微信小程序
顾青12 小时前
微信小程序实现身份证识别与裁剪(基于 VisionKit)
前端·微信小程序
從南走到北14 小时前
西陆房产系统小程序
微信·微信小程序·小程序
Q_Q196328847515 小时前
python+uniapp基于微信美食点餐系统小程序
spring boot·python·微信·django·flask·uni-app·node.js