hi,
I have two questions:
1.scrolling label can't be add to mainform.rootpane,why? (I used code :mainform.rootpane.add(XXXXXXXX),error message is "type doesn't match")
2.how to change speed rate of scrolling?
1. it is a customview. Use the designer to add a scrollinglabel
2. Play with the sleep-values
B4X:
Private Sub StartScrolling (p As B4XView, OriginalWidth As Float)
taskIndex = taskIndex + 1
Dim myIndex As Int = taskIndex
Dim duration As Int = p.Width / WidthPerSecond * 1000
Do While True
p.SetLayoutAnimated(duration, -(p.Width - OriginalWidth), p.Top, p.Width, p.Height)
Sleep(duration)
If myIndex <> taskIndex Then Return
Sleep(800)
p.SetLayoutAnimated(0, 0, p.Top, p.Width, p.Height)
If myIndex <> taskIndex Then Return
Loop
End Sub
You need to change WidthPerSecond in order to change the speed. I will make it a public variable in the next version of XUI Views. Note that the default value is 100dip.