iOS Question AS TabStrip - how to disable Viewpager scroll animation.

mcqueccu

Well-Known Member
Licensed User
Longtime User
Is it possible to disable the scroll animation between pages in the viewpager of the AS Tabstrip.

I am using As Tabstrip with 5 tabs. On B4A, if you are on tab1 and you click on tab5, there is instant jump.
But on B4i, the view seems to scroll through all the pages between.
 

Alexander Stolte

Expert
Licensed User
Longtime User
Actually, this is pointless to use the library, because it contains hardly any code. It is smarter to use the ViewPager and TabMenu separately instead of the TabStrip.

This is the code, as you can see it doesn't take any work away from you.
B4X:
Private Sub Class_Globals   
    Private gTabMenu As ASTabMenu
    Private gViewPager As ASViewPager
End Sub

'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize(TabMenu2 As ASTabMenu,ViewPager2 As ASViewPager)
    gTabMenu = TabMenu2
    gViewPager = ViewPager2
End Sub

Public Sub AddPage(tab_background_color As Int,tab_text As String,tab_icon As B4XBitmap,tab_tag As Object,pager_layout As B4XView,pager_value As Object)   
    gTabMenu.AddTab(tab_background_color,tab_text,tab_icon,tab_tag)
    gViewPager.AddPage(pager_layout,pager_value)   
End Sub

Public Sub RemovePage(index As Int)
    gTabMenu.RemoveAt(index)
    gViewPager.RemovePage(index)
End Sub

Public Sub ViewPager_PageChanged(index As Int)   
    gTabMenu.SetTab(index,False,False)
End Sub

Public Sub TabMenu_TabClick(index As Int)
    gViewPager.CurrentIndex = index   
End Sub

Public Sub getViewPager As ASViewPager
    Return gViewPager
End Sub

Public Sub getTabMenu As ASTabMenu
    Return gTabMenu
End Sub
 
Upvote 0
Top