Skip to content

Commit

Permalink
[Fixed 1087] Long titles display with a dots at the end, not hidden b…
Browse files Browse the repository at this point in the history
…ehind the buttons
  • Loading branch information
Ania Slimak committed Aug 23, 2016
1 parent e51207a commit 42e3480
Showing 1 changed file with 36 additions and 29 deletions.
65 changes: 36 additions & 29 deletions src/NavBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,13 @@ import _backButtonImage from './back_chevron.png';
const styles = StyleSheet.create({
title: {
textAlign: 'center',
marginTop: 10,
fontSize: 18,
color: '#0A0A0A',
fontSize: 18,
width: 180,
alignSelf: 'center',
},
titleWrapper: {
marginTop: 10,
position: 'absolute',
...Platform.select({
ios: {
Expand Down Expand Up @@ -76,7 +80,7 @@ const styles = StyleSheet.create({
position: 'absolute',
},
backButton: {
width: 130,
width: 100,
height: 37,
position: 'absolute',
...Platform.select({
Expand Down Expand Up @@ -413,32 +417,35 @@ class NavBar extends React.Component {
title = title(childState);
}
return (
<Animated.Text
{...this.props.titleProps}
key={childState.key}
style={[
styles.title,
this.props.titleStyle,
this.props.navigationState.titleStyle,
childState.titleStyle,
{
opacity: this.props.position.interpolate({
inputRange: [index - 1, index, index + 1],
outputRange: [0, this.props.titleOpacity, 0],
}),
left: this.props.position.interpolate({
inputRange: [index - 1, index + 1],
outputRange: [200, -200],
}),
right: this.props.position.interpolate({
inputRange: [index - 1, index + 1],
outputRange: [-200, 200],
}),
},
]}
>
{title}
</Animated.Text>
<Animated.View key={childState.key} style={styles.titleWrapper}>
<Animated.Text
lineBreakMode="tail"
numberOfLines={1}
{...this.props.titleProps}
style={[
styles.title,
this.props.titleStyle,
this.props.navigationState.titleStyle,
childState.titleStyle,
{
opacity: this.props.position.interpolate({
inputRange: [index - 1, index, index + 1],
outputRange: [0, this.props.titleOpacity, 0],
}),
left: this.props.position.interpolate({
inputRange: [index - 1, index + 1],
outputRange: [200, -200],
}),
right: this.props.position.interpolate({
inputRange: [index - 1, index + 1],
outputRange: [-200, 200],
}),
},
]}
>
{title}
</Animated.Text>
</Animated.View>
);
}

Expand Down

0 comments on commit 42e3480

Please sign in to comment.