Hello good afternoon, I have been trying various methods to disable the swipe movement when entering a page but there is no way I leave an example to see if you can help me.
I have tried this:
B4X:
Sub TabStrip1_PageSelected (Position As Int)
Log($"Current page: ${Position}"$)
If Position = 1 Then
Dim jo As JavaObject = TabStrip1
jo.GetFieldJO("vp").RunMethod("setOverScrollMode", Array(2)) 'NEVER
End If
End Sub
But it continues to slide perfectly to change to other pages and I want to disable the movement.
Thank you very much, greetings.
sub globals
.........
Dim ip As Int ' ip: selected page
Dim ipagen As Boolean
.......
end sub
' To block the page n
.......
ip= n
ipagen=True
tabstrip1.scrollto (n,False)
........
'page n "blocked" while running this part of code
.........
ipagen=False
Sub tabstrip1.pageselected (position As Int)
If ipagen Then
tabstrip1.scrollto (n,False)
ip=n
Else
ip-position
End If
End Sub
sub globals
.........
Dim ip As Int ' ip: selected page
Dim ipagen As Boolean
.......
end sub
' To block the page n
.......
ip= n
ipagen=True
tabstrip1.scrollto (n,False)
........
'page n "blocked" while running this part of code
.........
ipagen=False
Sub tabstrip1.pageselected (position As Int)
If ipagen Then
tabstrip1.scrollto (n,False)
ip=n
Else
ip-position
End If
End Sub
Thank you for the answer but it is not what I am looking for, the page is effectively blocked, but the horizontal scroll movement is still working and that is not useful for me. I want to disable that horizontal movement.
Overscroll Mode is not related. It is not possible to disable the sliding gesture. If there is a specific page where you want to disable scrolling then you can show a panel over TabStrip, with the relevant layout, when the page is selected.