Using the activity indicator requires the ActivityIndicator module.

import * as activityIndicatorModule from "tns-core-modules/ui/activity-indicator";

Binding the activity indicator busy property to a view-model property.

  <ActivityIndicator busy="{{ isLoading }}" />

Creating an activity indicator

var indicator = new activityIndicatorModule.ActivityIndicator();

Showing activity indicator while image is loading

var image = new imageModule.Image();
var indicator = new activityIndicatorModule.ActivityIndicator();
indicator.width = 100;
indicator.height = 100;

// Bind the busy property of the indicator to the isLoading property of the image
    sourceProperty: "isLoading",
    targetProperty: "busy"
}, image);
Is this article helpful? Yes / No
Thank you for your feedback!

Tell us how we can improve this article

NativeScript is licensed under the Apache 2.0 license .
© Progress Software Corporation. All Rights Reserved.