Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Center align Multiline Text Component #16866

Closed
AishwaryaSurana opened this issue Nov 17, 2017 · 1 comment
Closed

Center align Multiline Text Component #16866

AishwaryaSurana opened this issue Nov 17, 2017 · 1 comment
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@AishwaryaSurana
Copy link

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

OS: macOS Sierra 10.12.6
Node: 8.7.0
Yarn: Not Found
npm: 5.5.1
Watchman: 4.9.0
Xcode: Xcode 9.1 Build version 9B55
Android Studio: 2.3 AI-162.4069837

react-native: 0.49.5
react: 16.0.0-beta.5

Steps to Reproduce

1.Tried aligning through View Component
2.Tried aligning through Text Component

Expected Behavior

Text should be center aligned

Actual Behavior

Text not aligning to center

Reproducible Demo

If the <Text> is multilined than it is not center aligned


<View style = {{
    justifyContent: 'center',
    alignItems: 'center'}}>
          <Text style={{alignSelf:'center',fontSize:20,justifyContent:'center',alignItems:'center'}}>
             A very big multiline text that can not be accumulated in a single line is shown here with all the attributes trying to center it</Text>
        </View>
        
@AishwaryaSurana AishwaryaSurana changed the title Center align Text Component Center align Multiline Text Component Nov 17, 2017
@AishwaryaSurana
Copy link
Author

textAlign: 'center'

Will do the trick

@facebook facebook locked as resolved and limited conversation to collaborators Nov 17, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Nov 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

2 participants