Android Question why text is not scrolling even scrolling label is used.

Nitin Joshi

Active Member
Licensed User
Hi, I have observed that if text of the scrolling label is short (fitting in scrolling label width) then text does not scroll. I had to add spaces for scrolling the text, however, i do not want to do so because my scrolling text will be different at different instances.
 

Andrew (Digitwell)

Well-Known Member
Licensed User
Longtime User
I think that this is intended behaviour.

A custom view with a label that scrolls automatically when the text is wider than the label.
My emphasis.

Given that the source is available, you can change to operate as you would like.
 
Upvote 0

Andrew (Digitwell)

Well-Known Member
Licensed User
Longtime User
Sorry, I have not understood this statement.
What I meant is that you can open the library file and view the source and make any changes that you need. It would probably be best to rename the control to avoid confusions with the original control.

By the way, is there any way to know number of characters label can accommodate based on its width?

Width of text is dependant on font, font size and the actual characters in the text (for proportional fonts), spacing, padding, etc, so a generalised answer is not possible. when you have the actual text you can use various routines to get the actual size.

search for "measure" https://www.b4x.com/android/forum/pages/results/?query=measure
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Hi, I have observed that if text of the scrolling label is short (fitting in scrolling label width) then text does not scroll.
Sorry, but I do not understand your logic.
The purpose of the ScrollingLabel is to show the the user the hidden test by scrolling the text automatically.
Why do you want to scroll a text when everything is visible. I would prefer to read a static text when possible rather than a scrolling text.
 
Upvote 0

Nitin Joshi

Active Member
Licensed User
What I meant is that you can open the library file and view the source and make any changes that you need. It would probably be best to rename the control to avoid confusions with the original control.
I have never worked on library, but let me try, thanks for the advice.
Width of text is dependant on font, font size and the actual characters in the text (for proportional fonts), spacing, padding, etc, so a generalised answer is not possible. when you have the actual text you can use various routines to get the actual size.
I think I have to do some trial and error to find out number of spaces to be included to scroll the label.
Sorry, but I do not understand your logic.
The purpose of the ScrollingLabel is to show the the user the hidden test by scrolling the text automatically.
Why do you want to scroll a text when everything is visible. I would prefer to read a static text when possible rather than a scrolling text.
In my project, there are buttons covering full screen. I would like to scroll some message over the buttons from the middle of the screen. I do not want to occupy additional space to show the message.
 
Upvote 0

Nitin Joshi

Active Member
Licensed User
Because, I want to cover entire screen with buttons equally paced and at the same time, i want to pass some scrolling message.
 
Upvote 0

Nitin Joshi

Active Member
Licensed User
I have screen recorded file (to show my expectation) but attachment option is not allowing to attach the file.

Size of the file is <1Mb and its .mp4.

Please suggest how can i share the file.
 
Upvote 0
Top