nativescript-loading-indicator
nativescript-loading-indicator is a plugin for NativeScript which overlays a loading indicator on the current page. Can be used, for example, to prevent the UI being interacted with while data is being fetched from an API, while informing the user that something is happening.
Installation
tns plugin add nativescript-loading-indicator
Example
var LoadingIndicator = require("nativescript-loading-indicator").LoadingIndicator;
var loader = new LoadingIndicator();
var options = {
message: 'Loading...',
progress: 0.65,
android: {
indeterminate: true,
cancelable: false,
max: 100,
progressNumberFormat: "%1d/%2d",
progressPercentFormat: 0.53,
progressStyle: 1,
secondaryProgress: 1
},
ios: {
details: "Additional detail note!",
margin: 10,
dimBackground: true,
color: "#4B9ED6",
backgroundColor: "yellow",
hideBezel: true,
view: UIView,
mode:
}
};
loader.show(options);
loader.hide();
Options
- message:
string
Your message! - progress:
number
Set progress display
Android Specific
iOS Specific
Quick Mode
Reference:
MBProgressHUDModeDeterminate
MBProgressHUDModeAnnularDeterminate
MBProgressHUDModeDeterminateHorizontalBar
MBProgressHUDModeText
MBProgressHUDModeCustomView
- use with
customView: string
- local path to an image file
Screenshots