mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-23 20:10:49 +08:00
Add headerBackgroundTransitionPreset with 'toggle' 'translate' and 'fade' options
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
import React, { Component } from 'react';
|
||||
import { StyleSheet, View, Text } from 'react-native';
|
||||
import {
|
||||
createStackNavigator,
|
||||
HeaderStyleInterpolator,
|
||||
} from 'react-navigation-stack';
|
||||
import { createStackNavigator } from 'react-navigation-stack';
|
||||
|
||||
function createHeaderBackgroundExample(options = {}) {
|
||||
return createStackNavigator(
|
||||
@@ -94,15 +91,10 @@ function createHeaderBackgroundExample(options = {}) {
|
||||
}
|
||||
export const HeaderBackgroundDefault = createHeaderBackgroundExample();
|
||||
export const HeaderBackgroundTranslate = createHeaderBackgroundExample({
|
||||
transitionConfig: () => ({
|
||||
headerBackgroundInterpolator:
|
||||
HeaderStyleInterpolator.forBackgroundWithTranslation,
|
||||
}),
|
||||
headerBackgroundTransitionPreset: 'translate',
|
||||
});
|
||||
export const HeaderBackgroundFade = createHeaderBackgroundExample({
|
||||
transitionConfig: () => ({
|
||||
headerBackgroundInterpolator: HeaderStyleInterpolator.forBackgroundWithFade,
|
||||
}),
|
||||
headerBackgroundTransitionPreset: 'fade',
|
||||
});
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
|
||||
Reference in New Issue
Block a user