mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-24 04:25:34 +08:00
fix: add horizontal margin to centered title
This commit is contained in:
@@ -328,10 +328,9 @@ export default class HeaderSegment extends React.Component<Props, State> {
|
||||
<Animated.View
|
||||
pointerEvents="box-none"
|
||||
style={[
|
||||
headerTitleAlign === 'left' && {
|
||||
position: 'absolute',
|
||||
left: leftButton ? 72 : 16,
|
||||
},
|
||||
headerTitleAlign === 'left'
|
||||
? { position: 'absolute', left: leftButton ? 72 : 16 }
|
||||
: { marginHorizontal: 18 },
|
||||
titleStyle,
|
||||
titleContainerStyle,
|
||||
]}
|
||||
|
||||
@@ -7,7 +7,9 @@ type Props = TextProps & {
|
||||
};
|
||||
|
||||
export default function HeaderTitle({ style, ...rest }: Props) {
|
||||
return <Animated.Text {...rest} style={[styles.title, style]} />;
|
||||
return (
|
||||
<Animated.Text numberOfLines={1} {...rest} style={[styles.title, style]} />
|
||||
);
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
|
||||
Reference in New Issue
Block a user