Authored by 于良

限定导航栏标题长度和行数 review by yewanwan

'use strict';
import React from 'react';
import {AppRegistry, Platform, StyleSheet} from 'react-native';
import {AppRegistry, Platform, StyleSheet, Dimensions} from 'react-native';
import {
Provider,
... ... @@ -353,5 +353,7 @@ let styles = StyleSheet.create({
},
navTitle: {
color: 'white',
marginLeft: 60,
marginRight: 60,
},
});
... ...
... ... @@ -128,8 +128,9 @@ const styles = StyleSheet.create({
},
userInfoTitle: {
position: 'absolute',
left: 0,
left: 60,
right: 0,
width: Dimensions.get('window').width - 120,
bottom: 33,
fontSize: 14,
textAlign: 'center',
... ... @@ -383,6 +384,7 @@ class NavBar extends React.Component {
return (
<Animated.Text
key={childState.key}
numberOfLines={1}
style={[
styles.title,
this.props.titleStyle,
... ... @@ -415,7 +417,7 @@ class NavBar extends React.Component {
const shopName = this.props.getShopName ? this.props.getShopName(childState) : '';
return (
<View style={styles.userInfoContainer} >
<Text style={styles.userInfoTitle}>{shopName}</Text>
<Text style={styles.userInfoTitle} numberOfLines={1}>{shopName}</Text>
<TouchableOpacity
onPress={() => {Actions.Logout();}}
style={styles.whiteArrow}
... ...