Originally discovered on http://stackoverflow.com/questions/38579665/reactnative-activityindicator-not-showing-when-animating-property-initiate-false
If ActivityIndicator is initialized with animating={false}, the Indicator will stay hidden even when changing animating to true. When initialized as animating the changes behave as expected.
Tested on Android emulator and Device, running Android 6.0 and 6.0.1. Also tested on iOS device which works as expected. Testing done with Windows 8.1.
'use strict'
import React, { Component } from 'react';
import {
AppRegistry,
Text,
View,
TouchableHighlight,
ActivityIndicator
} from 'react-native';
class SampleApp extends Component {
constructor() {
super();
this.state = {
show: false
};
}
render() {
return (
<View>
<TouchableHighlight onPress={ () => this.setState({show: false}) } >
<Text>HIDE</Text>
</TouchableHighlight>
<TouchableHighlight onPress={ () => {this.setState({show: true}) } >
<Text>SHOW</Text>
</TouchableHighlight>
<ActivityIndicator animating={this.state.show} size="large"/>
</View>
);
}
}
AppRegistry.registerComponent('SampleApp', () => SampleApp);
Originally discovered on http://stackoverflow.com/questions/38579665/reactnative-activityindicator-not-showing-when-animating-property-initiate-false
If
ActivityIndicatoris initialized withanimating={false}, the Indicator will stay hidden even when changinganimatingtotrue. When initialized as animating the changes behave as expected.Tested on Android emulator and Device, running Android 6.0 and 6.0.1. Also tested on iOS device which works as expected. Testing done with Windows 8.1.