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.

renderLoading in not rendered in the correct position

See original GitHub issue

I just observed that in the latest version (compared to an old one) I am not able to render an ActivityIndicator centered on the screen while the webview is loading

renderLoading = () => ( <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}> <ActivityIndicator color={'#B9002F'} size="large" /> </View> );

render() { return ( <SafeAreaView forceInset={{top: 'always'}} style={{flex: 1, backgroundColor: '#fff'}}> <WebView source={this.source} startInLoadingState={true} renderLoading={this.renderLoading} /> </SafeAreaView> ); }

will not work as expected, the ActivityIndicator is rendered in the bottom of the screen

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

51reactions
kyo504commented, Nov 20, 2019

@mydesweb I have been faced with the same issue and found a solution by looking at the internal codes. The default style of loading view has following props:

  loadingOrErrorView: {
    position: 'absolute',
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    height: '100%',
    width: '100%',
    backgroundColor: 'white'
  },

which means that you can achieve what you expect if you pass following additional props to your style.

{
    position: 'absolute',
    height: '100%',
    width: '100%',
}

Hope this would be helpful for you.

13reactions
plaacommented, Mar 24, 2020

What are the magic words needed to keep an unresolved issue open (as annjawn’s comment clearly was insufficient)?

Read more comments on GitHub >

github_iconTop Results From Across the Web

React-Native: Show loading screen till the webview is loaded
My solution was actually quite simple, the WebView component can have the param renderLoading which for me was not working, I figured out...
Read more >
React Native Show Progress bar While Loading WebView
Hello sir, I need to show no internet connection with refresh button when there is no internet. I searched alot and tried but...
Read more >
Loading States with Suspense - Relay
To render loading states while a query is being fetched, we rely on React Suspense. Suspense is a new feature in React that...
Read more >
React Native Show Progress bar While Loading WebView
React Native Show Progress bar While Loading WebView.
Read more >
Creating a Chat Component With React Native | by Yash Gupta
renderLoading }text={this.props.text}placeholder={this.props. ... A lot right? ... If not, we proceed to render the actual chat screen.
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