mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-13 22:29:45 +08:00
NavigationAnimatedView configurable navigation timing
Summary:Add setTiming prop for custom timing configuration Also improve the current timing of the navigation animation to look more natural and less springy Reviewed By: javache Differential Revision: D2938500 fb-gh-sync-id: 3e6c6dd6077ff9d6a343f760f7b762096ce76600 shipit-source-id: 3e6c6dd6077ff9d6a343f760f7b762096ce76600
This commit is contained in:
committed by
facebook-github-bot-6
parent
dcb68db758
commit
19f81be9b4
@@ -15,6 +15,7 @@
|
||||
|
||||
var React = require('react-native');
|
||||
var {
|
||||
Animated,
|
||||
NavigationExperimental,
|
||||
StyleSheet,
|
||||
ScrollView,
|
||||
@@ -80,6 +81,9 @@ class NavigationAnimatedExample extends React.Component {
|
||||
getTitle={state => state.key}
|
||||
/>
|
||||
)}
|
||||
setTiming={(pos, navState) => {
|
||||
Animated.timing(pos, {toValue: navState.index, duration: 1000}).start();
|
||||
}}
|
||||
renderScene={(state, index, position, layout) => (
|
||||
<NavigationCard
|
||||
key={state.key}
|
||||
|
||||
Reference in New Issue
Block a user