fix: add horizontal margin to centered title

This commit is contained in:
satyajit.happy
2019-11-02 05:08:10 +01:00
parent 74ee216ed4
commit 2ef5ad4cc2
2 changed files with 6 additions and 5 deletions

View File

@@ -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,
]}

View File

@@ -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({