DEV Community

skptricks
skptricks

Posted on

React Native ActivityIndicator Andriod IOS Example

This tutorial explains how to display loading screen or activity indicator in react native application for android and ios device. ActivityIndicator is the common circular loading indicator used in both android and iOS devices. This type of loader which is basically used to display a loading dotted moving circle on android and iPhone devices, When user trying to loading something from server.

React Native ActivityIndicator Andriod IOS Example

React Native ActivityIndicator Example
Lets see the complete source code that helps to display loading screen or activity indicator in react native application for android and ios device.

Step 1: Create a new react native project, if you don’t know how to create a new project in react native just follow this tutorial.

Step 2: Open App.js File in your favorite code editor and erase all code and follow this tutorial.

Step 3: Through react , react-native packages import all required components.
import React, { Component } from 'react';
import { StyleSheet, View, ActivityIndicator, Button } from 'react-native';

Step 4: Lets create constructor block inside your App component. In the constructor block we have created state variables that helps to hide and show activity indicator from the device screen.

Read more...

Top comments (0)