ReactNative ActivityIndicator not showing when animating property initiate false

后端 未结 10 1698
悲哀的现实
悲哀的现实 2021-02-12 21:31

I\'m playing with react native and got a strange behaviour.

When I try to show a ActitvityIndicator for Android setting its animating property

10条回答
  •  盖世英雄少女心
    2021-02-12 22:18

    This is a bug of React-Native for component Activity Indicator. I am not sure that fb has already solved it but you can try this

     constructor(props) {
            super(props);
            this.state = {
                opacity: 0
            };
        }
    

    to show it use this.setState({opacity:1}) and to hide again this.setState({opacity:0}) in your called functions

    and in the render where you are using activity indicator

     
    

提交回复
热议问题