Android Question Text from SQLite into Label being truncated

Kevin Hartin

Active Member
Licensed User
This is my first question, so please bear with me.

I am reading a field from SQLite to populate a Label inside a ScrollView that sits on a tab in a TabStrip.

It all seems to be working fine, but it seems that the very long text strings are being truncated. For example, one string in the DB is 2123 chars long, but when I place it in the Label it gets truncated to 1638 chars. Another record of 3178 chars is being truncated at 1670, while a third of 1818 chars gets truncated at 1668.

I have checked the DB and it is right, I also see the ScrollView working properly, as the truncated texts all do scroll properly off the bottom of the screen.

Any help will be much appreciated.

Kev
 

walterf25

Expert
Licensed User
Longtime User
This is my first question, so please bear with me.

I am reading a field from SQLite to populate a Label inside a ScrollView that sits on a tab in a TabStrip.

It all seems to be working fine, but it seems that the very long text strings are being truncated. For example, one string in the DB is 2123 chars long, but when I place it in the Label it gets truncated to 1638 chars. Another record of 3178 chars is being truncated at 1670, while a third of 1818 chars gets truncated at 1668.

I have checked the DB and it is right, I also see the ScrollView working properly, as the truncated texts all do scroll properly off the bottom of the screen.

Any help will be much appreciated.

Kev
You might have to adjust the height of the label, this is just off the top of my head, I think every single character is being loaded, but you may have to adjust the height of the label, you could probably use the StringUtil library to measure the height based on the text you are assigning to the label and then adjust the height of the label accordingly, you may even have to adjust the scrollview's height as well to compensate for the label's height so that when you scroll down, everything will be visible.

Regards,
Walter
 
Upvote 0

Kevin Hartin

Active Member
Licensed User
I have the label set to 100%y and have tried setting the scrollview to > 100%y, but it makes no difference to the text displayed, only the look of the scrollview.
 
Upvote 0
Top