on this pageと書かれているように、デフォルトの画面遷移を上書きするには、transitionConfig
を使用する必要があります。
残念ながら、そこには例がその関数がどのように機能するか提供されていないが、あなたは、このファイルにいくつかの例を見つけることができます:\react-navigation\lib\views\CardStackStyleInterpolator.js
だからあなたのコードは次のようになります。
const navigator = StackNavigator(scenes, {
transitionConfig:() => ({
screenInterpolator: sceneProps => {
const { layout, position, scene } = sceneProps;
const { index } = scene;
const translateX = position.interpolate({
inputRange: [index - 1, index, index + 1],
outputRange: [layout.initWidth, 0, 0]
});
const opacity = position.interpolate({
inputRange: [index - 1, index - 0.99, index, index + 0.99, index + 1],
outputRange: [0, 1, 1, 0.3, 0]
});
return { opacity, transform: [{ translateX }] }
}
})
});
このページは 'https:// reactnavigation.org/docs/navigators/stack'について話していますか? Navigator.SceneConfigs関連の設定が見つかりませんでした。 –
'react-navite'のナビゲータは推奨されていません。 –