Hello,
This is a recurring problem slowing constantly my app, probably because it is not meant to be done this way.
What im trying to do is do a simple scrollview scroll upon the selection of one of its many textboxes.
For this i've used a for each such as this:
It works somewhat, however it is extremely slow on my ipad air recently bought. My question is as follows:
Is there a simple way to get the selected textbox without having to do such tedious loop? or at least the height?
Thank You!
Y.
This is a recurring problem slowing constantly my app, probably because it is not meant to be done this way.
What im trying to do is do a simple scrollview scroll upon the selection of one of its many textboxes.
For this i've used a for each such as this:
B4X:
For Each v As View In pnlMainInfo.GetAllViewsRecursive
If((v Is TextField And Not(Found)) ) Then
Dim txtf As TextField = v
If(txtf.IsFocused) Then
Found = True
KeyDifference = txtf.CalcRelativeKeyboardHeight(Height)
If(KeyDifference <0) Then
rx.sv.ScrollTo(0,-(KeyDifference-100),True)
End If
End If
Else if(v Is TextView And Not(Found)) Then
Dim txtv As TextView = v
If(txtv.IsFocused) Then
Found = True
KeyDifference = txtv.CalcRelativeKeyboardHeight(Height)
If(KeyDifference <0) Then
rx.sv.ScrollTo(0,-(KeyDifference-100),True)
End If
End If
End If
Next
If(Not(Found)) Then
rx.sv.ScrollTo(0,0,True)
End If
It works somewhat, however it is extremely slow on my ipad air recently bought. My question is as follows:
Is there a simple way to get the selected textbox without having to do such tedious loop? or at least the height?
Thank You!
Y.