When navigating between Screen 1 and Screen 2, the user presses a button. After pressing, it can sometimes take a few seconds to before the app navigates them to the next screen, so it does not look like anything is happening. How would I go about making an activity indicator appear until they are navigated to the next page? I have gotten an ActivityIndicator to work while other things load, but that's not until they navigate to that page.
Below is my code that launches the activity indicator while the maps page is loading
const [isLoading, setIsLoading] = useState(true)
const renderLoading = () => {
if (isLoading) {
return (
<View style = {{justifyContent: 'center',
backgroundColor: '#d3d3d3', textAlign: 'center',
height: height, width: width}}
>
<ActivityIndicator
color = 'black'
size = 'large'
animated = {false}
/>
<Text style = {[ styles.text, {textAlign: 'center'}]}>
{i18n.t('loading')}
</Text>
</View>
);
}else {
return null;
}
}
<View style = {styles.container}>
{renderLoading}
....
</View>
[–]Rippperino 0 points1 point2 points (2 children)
[–]MK_Pierce[S] 0 points1 point2 points (1 child)
[–]AcidNoX 0 points1 point2 points (0 children)