Skip to content
This repository has been archived by the owner on Apr 27, 2019. It is now read-only.

Text inside ScrollView not reaching to the end #25

Closed
ghost opened this issue May 3, 2014 · 7 comments
Closed

Text inside ScrollView not reaching to the end #25

ghost opened this issue May 3, 2014 · 7 comments

Comments

@ghost
Copy link

ghost commented May 3, 2014

When you put the TextViewEx inside a ScrollVIew the scroller doesnt show complete text, it leaves some behind, its like its not calculating the height properly.

This is the beggining of the textViewEx
screenshot 2014-05-03 17 03 00

This is the bottom, and the scroller its maxed out, and as you can see some of the text is missing.
screenshot 2014-05-03 17 03 18

@ghost
Copy link
Author

ghost commented May 3, 2014

solved it adding more padding to the bottom

TextViewEx.java:81
super.setPadding(left+10, top, right+10, bottom+80);

EDIT:
Not solved, on bigger texts the problem returns... andy ideas?

@jribal
Copy link

jribal commented May 21, 2014

+80 use real pixels, you have to use dp to be screen independant.

DisplayMetrics metrics = getContext().getResources().getDisplayMetrics();
super.setPadding((int)((left+(metrics.density * 10))), top, (int)(right+(metrics.density * 10)), (int) (bottom+(metrics.density * 40)));

@ralf89
Copy link

ralf89 commented Jul 16, 2014

Android match_parent doesn't actually realize that justified text occupies more height then regular text so the content is wrapped according to regular text alignment. Is there a way to tell android that the wrap content has to be made with the justified text method?

I solved it giving an actual layout_height that covers the entire justified text height but I wanted to know if it is the only solution or is it possible to tell the match_parent the actual text height putting some more code in the TextViewEx ?

@praveen-kanwar
Copy link

All You Can Do Is while setting text textViewEx.setMinLines(value); And Value Can Be Calculated Through (yourText.length()/30) considering one line contain on average 30 characters.

@praveen-kanwar
Copy link

Another Tweak Inside Your XML Put android:lineSpacingMultiplier="1.2" And Inside Your Extended TextView there is a temporary fix comment verticalOffset = horizontalFontOffset = getLineHeight(); at this line Put There verticalOffset = horizontalFontOffset = getLineHeight() - 8;

@mathew-kurian
Copy link
Owner

Refer to the experimental version posted on README.md

@mathew-kurian
Copy link
Owner

Refer to updated version. It has been fixed along with major optimizations.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants