ActivityIndicator

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.

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

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
indicator.bind({
    sourceProperty: "isLoading",
    targetProperty: "busy"
}, image);

Stay connected with NativeScript

(expect a newsletter every 4-8 weeks)

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