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

相关推荐
西洼工作室11 小时前
个人开发者接入阿里云号码认证服务AliCloud-NirvanaPns实现一键登录
python·阿里云·uni-app·全栈·认证授权
2501_9160088917 小时前
ChatGPT前端开发学习指南:Visual Studio Code与谷歌浏览器安装配置详解
ide·vscode·ios·小程序·uni-app·编辑器·iphone
2501_9159090620 小时前
完整指南:如何将iOS应用上架到App Store
android·ios·小程序·https·uni-app·iphone·webview
無名路人1 天前
uniApp 小程序 vue3 app.vue静默登录其他页面等待登录完成方式二
前端·微信小程序·ai编程
xiangxiongfly9152 天前
uni-app 组件总结
前端·javascript·uni-app
2501_915918412 天前
iOS性能数据监控:从概念到工具实践,让应用运行更流畅
android·macos·ios·小程序·uni-app·cocoa·iphone
silvia_Anne2 天前
微信小程序(组件通讯和全局数据共享)
微信小程序·小程序
i220818 Faiz Ul2 天前
个人健康系统|健康管理|基于java+Android+微信小程序的个人健康系统设计与实现(源码+数据库+文档)
android·java·vue.js·spring boot·微信小程序·毕设·个人健康系统
2501_915909062 天前
全面解析前端开发中常用的浏览器调试工具及其使用场景
android·ios·小程序·https·uni-app·iphone·webview
wuxianda10303 天前
uniapp项目上架苹果商店4.3a被拒,3天极速解决方案2026.5.8
前端·人工智能·flutter·uni-app·ios上架·苹果上架·苹果4.3a