Skip to content
This repository was archived by the owner on Jun 24, 2021. It is now read-only.
This repository was archived by the owner on Jun 24, 2021. It is now read-only.

Not working on iOS onLoaded or programmatically #63

@seergiue

Description

@seergiue

Hello! This plugin works perfect for all cases except for the one I'm going to describe.

I want to be able to fire the "refreshing" property programmatically whenever I want. For Android works perfect, but for iOS it doesn't work.

I'm using nativescript-vue and doing the following:

  • This is the view
<PullToRefresh ref="pullToRefresh" @refresh="onRefresh" row="1" col="0" color="red">
    <ListView for="item in listOfItems" @itemTap="onTap">
        <v-template>
            <Label text="item.text" />
        </v-template>
    </ListView>
</PullToRefresh>
  • This is where I handle the event
onRefresh(args) {
    let pullRefresh = args.object;
    setTimeout(function() {
        pullRefresh.refreshing = false;
    }, 2000);
}
  • Then I have a "loaded" event on the Page tag that will fire once the page is loaded and the following function will handle the event
let pullRefresh = this.$refs.pullToRefresh.nativeView;
pullRefresh.refreshing = true;
setTimeout(function() {
    pullRefresh.refreshing = false;
}, 2000);

As you can see I'm getting the nativeView of pull to refresh and changing the refreshing property programatically. It works but on iOS the color I applied to the ActivityIndicator is lost. Now If I apply the same logic to a button that fires this last function then on iOS it doesn't work at all, the ListView won't scroll itself and it won't display the ActivityIndicator.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions