question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug in android on ActivityIndicator!!

See original GitHub issue

image

when init the ActivityIndicator 's animating atrribute to be false , it will never be show if you rerender it .

here is source code

import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  ActivityIndicator,
  View
} from 'react-native';

export default class AwesomeProject extends Component {

constructor(){
      super()
        this.state = {
             isloading:false,
        }
    }

  render() {
    return (


      <View style={{flex:1}}>
          <Text  onPress={()=>{
            this.setState({isloading:!this.state.isloading })
          }}>
          click-isloading</Text>
          <ActivityIndicator  animating={this.state.isloading}/>
        </View>
     
  

    );
  }
}


AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject);

android 6.1 ,reactnative 0.39 ,the latest version

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
aqnarutocommented, Dec 31, 2016

yeah,but when i setstate animating :true it is still hide . if you initial false it is will never show @johnryan

2reactions
vonovakcommented, Jan 5, 2017

I have met similar bugs. It is not about activity indicator but how the scene is re-rendered. Interesting is that this rnplay works. you can work around it by saying {this.state.isloading && <ActivityIndicator/>}

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native ActivityIndicator not displaying - Stack Overflow
The problem is, it doesn't show the ActivityIndicator . Everything else is appearing. Tested both in real mobile device (Redmi Note 7 Pro)...
Read more >
Android : React Native ActivityIndicator not displaying - YouTube
Android : React Native ActivityIndicator not displaying [ Beautify Your Computer : https://www.hows.tech/p/recommended.html ] Android ...
Read more >
NativeScript ActivityIndicator Size - YouTube
In this NativeScript tutorial we'll tackle the problem of changing the ... This is a widget that behaves differently on iOS and Android, ......
Read more >
ActivityIndicator - NativeScript Docs
ActivityIndicator is an abstraction over Android's ProgressBar and iOS's ... The ActivityIndicator's value could be controlled via its `busy` property.
Read more >
ActivityIndicator doesn't work | Telerik Forums
I was attempting to use an ActivityIndicator ... but when I instantiate a ActivityIndicator() object my app crashes on iOS and Android.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found