Skip to content

Commit 0851344

Browse files
committed
Merge pull request #34 from charpeni/fix-center-title-ios
Fix center issue with navbar title on iOS
2 parents 3ddeab9 + 2ba03af commit 0851344

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

components/NavBarContent.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { StyleSheet, Text, View, Animated, Easing, PropTypes } from 'react-native';
1+
import React, { StyleSheet, Text, View, Animated, Easing, PropTypes, Platform } from 'react-native';
22
import NavButton from './NavButton';
33
import * as Styles from '../styles';
44

@@ -145,7 +145,7 @@ class NavBarContent extends React.Component {
145145
);
146146
}
147147

148-
if (this.props.route.leftCorner || this.props.route.index > 0) {
148+
if (Platform.OS === 'ios' || this.props.route.leftCorner || this.props.route.index > 0) {
149149
leftCorner = (
150150
<View style={[this.styles.corner, this.styles.alignLeft]}>
151151
{leftCornerContent}
@@ -167,7 +167,9 @@ class NavBarContent extends React.Component {
167167
{...this.props.route.rightCornerProps}
168168
/>
169169
);
170+
}
170171

172+
if (Platform.OS === 'ios' || this.props.route.rightCorner || this.props.rightCorner) {
171173
rightCorner = (
172174
<View style={[this.styles.corner, this.styles.alignRight]}>
173175
{rightCornerContent}

0 commit comments

Comments
 (0)