简体   繁体   中英

Custom transition using pan gesture on nativescript core

Is it possible to achieve the page transition shown in the image below using nativescript core?

As you can see, to make the transition from one view to the previous (parent) one, I'm making a pan gesture slowly and depending on where my finger horizontally is, the view is being shown and coming into existence from left. You can't see the finger but you can see the slow transition controlled by my finger. I'm making a pan gesture from very left of screen to the right. The transitions that I've so far read about, run in one go without giving any control to the user. Is this one possible using nativescript core?

ios过渡示例

So far I've tried writing a custom transition class/method and providing it as a transition instance to navigation entry, but couldn't find a way to manually control the actual transition using pan gesture.

const customNavigation = new CustomTransitionIOS(4000, 2);
const navigationEntry: NavigationEntry = {
    moduleName: "settings",
    animated: true,
    transition: {
        instance: customNavigation
    },
    context: {
        name: "John"
    },
    clearHistory: true
};

Found it. I actually needed to use Frame.topmost() function instead of simply navigating to another view.

Frame.topmost().navigate('another-page');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM