Skip to content

numberOfLines does not work! #15732

@xclidongbo

Description

@xclidongbo

Is this a bug report?

(write your answer here)
NO

Have you read the Contributing Guidelines?

(Write your answer here.)
Yes

Environment

  1. react-native -v:2.0.1
  2. node -v:v8.2.1
  3. npm -v:5.3.0
  4. yarn --version:0.27.5

react-native-cli: 2.0.1
react-native: 0.47.2
node v8.2.1
npm 5.3.0
Then, specify:

  • Target Platform:iOS
  • Development Operating System: macOS
  • Build tools:Xcode

Steps to Reproduce

(Write your steps here:)

      <View style={{flex: 1, alignItems: 'center', backgroundColor: 'red'}}>
        <Text style={{margin: 20, textAlign: 'center',backgroundColor: 'white'}}>文本样式继承</Text>
        <View style={{marginHorizontal: 20,alignSelf: 'flex-start', backgroundColor: '#333333'}}>
          <Text style={{color: 'white',marginHorizontal: 20}}>
            <Text style={{color: 'red'}} >
              文本元素{'\n'}
              <Text
                style={{ backgroundColor: 'yellow'}}
                numberOfLines={1}
                ellipsizeMode="clip">
                我是白色的还是红色的我是白色的还是红色的我是白色的还是红色的我是白色的还是红色的我是白色的还是红色的我是白色的还是红色的{'\n'}
                我是白色的还是红色的我是白色的还是红色的我是白色的还是红色的我是白色的还是红色的我是白色的还是红色的我是白色的还是红色的{'\n'}
              </Text>
            </Text>
            <Text>我是白色的还是红色的</Text>
          </Text>
        </View>
      </View>

numberOfLines does not work!

Expected Behavior

(Write what you thought would happen.)

Actual Behavior

(Write what happened. Add screenshots!)

Reproducible Demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions