问题
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?
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
};
回答1:
Found it. I actually needed to use Frame.topmost() function instead of simply navigating to another view.
Frame.topmost().navigate('another-page');
来源:https://stackoverflow.com/questions/60350070/custom-transition-using-pan-gesture-on-nativescript-core