question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Text cut off at the bottom (in Android)

See original GitHub issue

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment: OS: macOS High Sierra 10.13.1 Node: 8.2.1 Yarn: 0.27.5 npm: 5.3.0 Watchman: 4.7.0 Xcode: Xcode 9.1 Build version 9B55 Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed) react: 16.0.0 => 16.0.0 react-native: 0.50.3 => 0.50.3

Steps to Reproduce

  1. Create a brand new app (with create-react-native-app for example)
  2. Render a text
  3. Set the style of this text to {fontSize: 72, lineHeight: 72}

Expected Behavior

I expected the text to not be cut off at the bottom, as it does (correctly) when leaving out lineHeight.

Actual Behavior

As soon as we define a lineHeight (even if it’s the same as its fontSize) the bottom part gets cut off:

screen shot 2017-12-04 at 15 18 03

(where the first one is without lineHeight and the second one is with {fontSize: 72, lineHeight: 72})

Reproducible Demo

https://snack.expo.io/BJT3KRzZM

Additional notes

  • It’s not possible to compensate the cut off part with a paddingBottom (which could be done with similar issues in higher areas of a Text component, using paddingTop)
  • This is a similar bug as https://github.com/facebook/react-native/issues/7687, which is closed due to inactivity

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:9
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
tdekoningcommented, Dec 5, 2017

I’ve looked into if this is even possible in native Android, and turns out that it works just fine. Setting android:lineSpacingMultiplier at a value of something like 0.5 on a TextView will result in the lines of text being quite close to each other, but the letters are never cut off.

I did not have the time to figure out where in the React-native logic this fails, but it seems like a bug in React-native to me.

1reaction
Jpuntcommented, Feb 9, 2018

Indeed, this was fixed in 0.52 🎉 🙌

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Textview text cut off at bottom - Stack Overflow
One of your LinearLayouts has height set to fill_parent . change it to wrap_content . Also, remove the min_height attribute.
Read more >
When you see cutoff at the bottom of your textview - Treehouse
If such situation happens, just change android:layout_width part in your text view parenthesis to "wrap_content". ex) android:layout_width=" ...
Read more >
Some characters missing or cut off when displayed on screen ...
When you view your document in Microsoft Word, some characters may be missing, or the top (or bottom) of some characters may be...
Read more >
android textview cut off bottom
3,234 Points When you see cutoff at the bottom of your textview Not a question but FYI, If such situation happens, just change...
Read more >
Truncated/Cut off text in various places? - Google Pixel 6 Pro
It's a combination of Font size & Display size that is probably your issue. Try mine and see if that helps. #2 markdoc,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found