-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scrollview自定义下拉刷新如何更改加载动画? #11495
Comments
等待热心的小伙伴解决问题中..., 有一些相关的 issues 可能帮助到你! Thank you so much! |
没有官方人员回答这个问题吗?现在我只能混合原生开发,我想知道是不是Taro的写法跟原生不一样?这样省去很多麻烦 |
|
|
|
就是用的 例子: import { useState, useCallback } from 'react'
import { View, ScrollView, Slot } from '@tarojs/components'
export default function () {
const scrollStyle = {
height: '150px'
}
const vStyleA = {
height: '150px',
'background-color': 'rgb(26, 173, 25)'
}
const vStyleB = {
height: '150px',
'background-color': 'rgb(39,130,215)'
}
const vStyleC = {
height: '150px',
'background-color': 'rgb(241,241,241)',
color: '#333'
}
function onScroll (e) {
console.log(e.detail)
}
return (
<ScrollView
className='scrollview'
scrollY
style={scrollStyle}
onScroll={onScroll}
refresherEnabled
refresherDefaultStyle='none'
refresherBackground="lightgreen"
>
<Slot name='refresher' style="display: block; width: 100%; height: 80px; background: blue; display: flex; align-items: center;">
<View style="position: absolute; text-align: center; width: 100%;">
下拉刷新
</View>
</Slot>
<View style={vStyleA}>A</View>
<View style={vStyleB}>B</View>
<View style={vStyleC}>C</View>
</ScrollView>
)
} |
不行,slot里的内容应该是下拉的时候才显示这样写一开始就显示了。 |
因为 style 的问题 |
|
可以把 <template name="tmpl_0_slot">
<view slot="{{i.name}}" style="{{i.st}}" class="{{i.cl}}" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.e(cid+1)}}" data="{{i:item,l:l}}" />
</block>
</view>
</template> |
相关平台
微信小程序
小程序基础库: 2.19.3
使用框架: React
复现步骤
scroll-view 自定义下拉刷新示例
在开发者工具中预览效果
小程序官方文档有示例代码如下
<scroll-view scroll-y> <view slot="refresher">自定义刷新动画</view> <scroll-view/>
view slot="refresher"
里的内容可以替换自带的3个点的下拉刷新动画taro这么写没有效果
<ScrollView scrollY> <View slot="refresher"> 自定义刷新动画 </View> </ScrollView>
期望结果
如果更改scrollview自定义下拉刷新的动画效果
实际结果
对照小程序文档写法无效
环境信息
补充信息
自定义下拉刷新动画效果
The text was updated successfully, but these errors were encountered: