Home > Web Front-end > JS Tutorial > body text

How to show progress bar in ReactNative?

WBOY
Release: 2023-09-10 20:37:01
forward
1082 people have browsed it

ProgressBar is a way of telling the user that content will be available at some point. It's best used when you are submitting content to the server and waiting for the server to respond.

To use the progress bar component, please use npm to install the react-native-paper module.

The command to install react-native-paper is-

npm install --save-dev react-native-paper
Copy after login

The basic composition of the progress bar is as follows-

<ProgressBar progress={progress_number} color="progresscolorbar" />
Copy after login

To use the progress bar, you need to install it from react-native-paper Import it as shown below -

import { ProgressBar} from &#39;react-native-paper&#39;;
Copy after login
Copy after login

Here are some important properties available on ProgressBar-

Sr.NoProps Vs. Description
1Progress

The value range is 0 to 10. The value to be displayed in the progress bar.

2Color

The color of the progress bar.

3It can be seen that the

value is true/false. It helps to show/hide progress bar.

4 style

The style applied to the progress bar.

Example: Displaying a progress bar

Displaying a progress bar is very simple. Just import it from react-native-paper first.

import { ProgressBar} from &#39;react-native-paper&#39;;
Copy after login
Copy after login

The code to display the progress bar is as follows -

<ProgressBar style={{ marginTop:200}} progress={0.5} color="#00BCD4" />
Copy after login

The default value is 0.5 and will increase to 10.

import * as React from 'react';
import { ProgressBar} from &#39;react-native-paper&#39;;
const MyComponent = () => (
   <ProgressBar style={{ marginTop:200}} progress={0.5} color="#00BCD4" />
);
export default MyComponent;
Copy after login

Output

How to show progress bar in ReactNative?

The above is the detailed content of How to show progress bar in ReactNative?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!