方法一:通过设置CSS样式禁止滑动 通过设置scroll-view的CSS样式,可以禁止其滚动。具体做法是将overflow属性设置为hidden,这样可以隐藏滚动条并禁止滚动。 html <scroll-view style="height: 300px; overflow: hidden;"> <!-- 内容 --> </scroll-view> 在这个例子中,scroll-view的高度被...
小程序里使用scroll-view,然后发现在iOS下不能滚动,在安卓下正常。 先确认scroll-y="true" 一定需要给scroll-view设置一个高度,具体的根据你自己的页面来 ,可以getSystemInfo获取可视区域的高度 constres=uni.getSystemInfo({success:(res=>{this.clientHeight=res.windowHeight-getApp().globalData.navHeight-50;})...
给scroll-view设置样式 white-space: nowrap 然后scroll-view里面的子项要设置样式为 display: inline-block; 接着scroll-view的属性scroll-x要设置为true scroll-x="true" 如果这都不出现滚动,那么原因可能有二: 1.scroll-view的宽度大于或等于父级的宽度,解决方案为:手动设置scroll-view的宽度,直至能滑动为止,...
1 scroll-y设置为true,在小程序,web都可以滑动,实现上拉加载 2 在手机上无法触发滑动加载,此时要给scroll-view一个高度,就可以解决。
100vh;width:80%':scroll-y="true":scroll-into-view="intoId"><view><viewv-for(item,index)inlist:key='index'><view:id="'dom_'+item.id">分类名称</view><viewv-for(subItem,subIndex)initem.subList:key='subIndex'>商品名称</view></view>...更多数据(略)</view></scroll-view></view>...
无法滚动,求解,是哪里的问题`<template> <view> <view> <view> <!-- scroll-left="120";右边的元素上来的距离 --> <scroll-view class="scroll-view_H" scroll-x="true"> <view class="scroll-view-item_H" v-for="(huadong,index) in huadongs" :key="index"> <view>x</view> <view><imag...
uniapp解决scroll-view滑动事件失效问题@scrolltolower 1、首先scroller-view需要给定高度,这里的高度最好不要是width:num%这种类型的,很容易不生效。 2、父容器最好也指定高度 下面通过举例来说明 <template> <view class="main"> <scroll-view class="scroll-content" scroll-y @scrolltolower="reachBottom"> ...
uni-app的vue页面,app端scroll-view的滚动条设置,可通过css的-webkit-scrollbar自定义,包括隐藏滚动条。(app-nvue无此css) 在pages.json页面增加以下配置: "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages ...
scroll-view在使用@scroll、@scrolltolower、@scrolltoupper、upper-threshold、lower-threshold ...等熟悉或事件时,不生效,是因为scroll-view没有一个固定的高度,所以需要给容器设定一个高度。 scroll-view开启下拉刷新后,无论在什么位置触摸下滚,都算在进行下拉,这个也是因为没有设置固定高度的问题。 如果...
scroll-view ::-webkit-scrollbar { //下面四个属性,选一个就可 display:none; width:0; height:0; background-color:transparent; } 2. /deep/::-webkit-scrollbar { display:none; width:0; height:0; color:transparent; background:transparent; ...