zoukankan      html  css  js  c++  java
  • RN animated帧动画

    效果图:

    代码:

    export default class AnimationFrameScene extends Component {
    
        constructor () {
            super()
            this.animatedValue = []
            arr.forEach((value) => {
                this.animatedValue[value] = new Animated.Value(0)
            })
        }
    
        componentDidMount () {
            this.animate()
        }
    
        animate () {
            const animations = arr.map((item) => {
                return Animated.timing(
                    this.animatedValue[item],
                    {
                        toValue: 1,
                        duration: 50
                    }
                )
            })
            Animated.sequence(animations).start()
        }
    
        render() {
            const arr = []
            for (var i = 0; i < 500; i++) {
                arr.push(i)
            }
    
            const animations = arr.map((a, i) => {
                return <Animated.View key={i} style={{opacity: this.animatedValue[a], height: 20,  20, backgroundColor: 'red', marginLeft: 3, marginTop: 3}} />
            })
    
            return (
                <View style={styles.container}>
                    {animations}
                </View>
            );
        }
    }
    
    const styles = StyleSheet.create({
        container: {
            flex: 1,
            flexDirection: 'row',
            flexWrap: 'wrap'
        },
    
    
    });
    
  • 相关阅读:
    Navicat12激活,最新版本v12.1.18,原版激活[windows]
    【工具】Fiddler使用教程
    MongoDB笔记
    MongoDB
    MySQL三层结构、用户权限、索引设计原则
    Ajax
    linux简单优化
    linux基本
    Memcached
    Django+Uwsgi+Nginx
  • 原文地址:https://www.cnblogs.com/hualuoshuijia/p/10184759.html
Copyright © 2011-2022 走看看