mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-29 04:45:19 +08:00
feat: use Animated.X for header title and background
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import * as React from 'react';
|
||||
import { View, StyleSheet, Platform, ViewProps } from 'react-native';
|
||||
import { StyleSheet, Platform, ViewProps } from 'react-native';
|
||||
import Animated from 'react-native-reanimated';
|
||||
|
||||
export default function HeaderBackground({ style, ...rest }: ViewProps) {
|
||||
return <View style={[styles.container, style]} {...rest} />;
|
||||
return <Animated.View style={[styles.container, style]} {...rest} />;
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import * as React from 'react';
|
||||
import { Text, StyleSheet, Platform, TextProps } from 'react-native';
|
||||
import { StyleSheet, Platform, TextProps } from 'react-native';
|
||||
import Animated from 'react-native-reanimated';
|
||||
|
||||
type Props = TextProps & {
|
||||
children?: string;
|
||||
};
|
||||
|
||||
export default function HeaderTitle({ style, ...rest }: Props) {
|
||||
return <Text {...rest} style={[styles.title, style]} />;
|
||||
return <Animated.Text {...rest} style={[styles.title, style]} />;
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
|
||||
Reference in New Issue
Block a user