Android Question How to display scrolling multiline text in fix Label size?

esotelo

New Member
Hello,

I am absolute noob to B4A - just started to play around with it a bit.
I have some experience from past times in classic VB6.0 and earlier versions.

Just working my way through some of the examples in B4A and works great so far.

I already tried the search function here, but most things I come up with are not related to my problem.
(e.g. I found examples on how to adapt label size to multiline text, but my problem is opposit)

I have an Activity with a simple label on it. It is displaying plain text strings which are comming in from an external data logger via USB serial port.

I just append the incoming serial USB string to a string acting as a buffer and display it in a fixed size label (to act as a display of received data).

So far this works well until the label is full with characters (several lines, depending on how large I make the size of the label) and then the appended text disapears below the bottom boundary of the label.

Is there a way to detect the amount of lines and characters per line currently displayed in a multi line label? This way I cold then just cut-off the first line using string manipulation functions and the incoming data would scroll upwards this way line by line...

Thanks for your help,

Eric
 

TomA

Active Member
Licensed User
Longtime User
Take a look at these examples:
..Example 1
.
.Example 2
These should get you started with what you want to do.
I adapted these approaches for several of my apps where the user is typing in something then the app responds with more text. The typed in strings and the responses are both appended to the label and the label is contained within a scrollview and the view always scroll to the last line added.
 
Upvote 0
Top