I need to show a long list of elements in a LongTextTemplate Dialog
Since it's a chronological list, I'd like to to show it already scrolled to the last item using the following code, but it keeps opening at the top of the list
B4X:
LongTextTemplate.Text = csText
Dim sf As Object = Dialog.ShowTemplate(LongTextTemplate, "Ok", "", "")
LongTextTemplate.CustomListView1.ScrollToItem(LongTextTemplate.CustomListView1.Size - 1)
Sleep(0)
Wait For (sf) Complete (Result As Int)
Dim sf As Object = Dialog.ShowTemplate(LongTextTemplate, "Ok", "", "")
LongTextTemplate.CustomListView1.sv.ScrollViewOffsetY = LongTextTemplate.CustomListView1.sv.ScrollViewContentHeight
Dim sf As Object = Dialog.ShowTemplate(LongTextTemplate, "Ok", "", "")
LongTextTemplate.CustomListView1.sv.ScrollViewOffsetY = LongTextTemplate.CustomListView1.sv.ScrollViewContentHeight
Sleep(0)
Wait For (sf) Complete (Result As Int)
but still Dialog show the first lines of text instead of the last ones
Sleep or no Sleep makes no difference
moving the sleep before the offset solved the issue
just for the sake of learning: what is the rationale?
i thought i should put the sleep after setting the offset to allow the system to process the message, but putting it beforehand makes just broke my reasoning