iOS Question Caos trying to find an alternative to ASViewPager that is CrossPlatform

EduardoElias

Well-Known Member
Licensed User
Longtime User
I am very frustrated on how difficult is to have an app that can work with simple things on both platforms...

The problem, already reported, is that ASViewPager cannot support MapFragment correctly

I am trying to use TabStrip as an alternative. On android it is fine, I can hide the top tabs (I need only the pages with no tab labels)

However on iOS I cant do that apparently. Is there a solution for that ? is there an alternative?

Eventually I could use something else on iOS that works, Is there an option?

Please help ! I am already having a big delay because many of the compatibility issues...
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
iTabStrip and TabStripViewPager are quite similar to each other.

Have you tried to put the TabStrip with its top outside of the page bounds?

Another option is to use SnapCLV (see the code in post #6 for horizontal scrolling) + xCLV.
 
Upvote 0

EduardoElias

Well-Known Member
Licensed User
Longtime User
iTabStrip and TabStripViewPager are quite similar to each other.

Have you tried to put the TabStrip with its top outside of the page bounds?

Another option is to use SnapCLV (see the code in post #6 for horizontal scrolling) + xCLV.
My intention is to have a page changer like ASViewPager (MapFragment does not work in it)

TabStrip on android has the Tab Height property that setting to zero totally remove the tabs, so I can use it with wooblemenu.

However on iOs TabStrip there is no such option.

I dont see how SnapCLV would help. I really need a page changer. I have tried to do something by myself on iOS but seems like things behave differently on iOS.
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
Please take a look and tell me if this works for you. I've tried as best as I can to make it consistent across platforms. With the tabstrip you could unfortunately only add page with "LoadLayout", so I had to switch to the AHViewPager.

B4A:
AHViewPager
B4I:
iTabstrip
 

Attachments

  • ASViewPagerNative Example.zip
    13.7 KB · Views: 205
Upvote 0

EduardoElias

Well-Known Member
Licensed User
Longtime User
Please take a look and tell me if this works for you. I've tried as best as I can to make it consistent across platforms. With the tabstrip you could unfortunately only add page with "LoadLayout", so I had to switch to the AHViewPager.

B4A:
AHViewPager
B4I:
iTabstrip
thank you for your help!

B4X:
Public Sub AddPages(ListOfPanels As List,Text As String)
    
    #If B4A
    imgLayout.Initialize
    
    For i = 0 To ListOfPanels.Size -1
        
        imgLayout.AddPage(ListOfPanels.Get(i).As(Panel),"")
        
    Next
    
    AHViewPager1.PageContainer = imgLayout
    #Else If B4I
    TabStrip1.SetPages(ListOfPanels)
    TabStrip1.CurrentPage = 0
    #End If
End Sub

on Android it says ViewPager does not have this property:

AHViewPager1.PageContainer = imgLayout
 
Upvote 0

EduardoElias

Well-Known Member
Licensed User
Longtime User
did you have AHViewPager 3.00?
I didnt know there is a new version, for some reason is not showing up on the library page, I have downloaded and installed and compiled ok!

question:

B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    
    B4XPages.SetTitle(Me,"ASViewPagerNative Example")
    
    Wait For B4XPage_Resize (Width As Int, Height As Int)
    
    Dim lst As List
    lst.Initialize
    
        
        #If B4A
        Dim xpnl As B4XView = xui.CreatePanel("")
        xpnl.Color = Rnd(xui.Color_Black,xui.Color_White)
        xpnl.SetLayoutAnimated(0,0,0,Root.Width,Root.Height)
        xpnl.LoadLayout("map")
        lst.Add(xpnl)
        #Else If B4I
        Dim page As Page
        page.Initialize("page")
        page.RootPanel.Color = Rnd(xui.Color_Black,xui.Color_White)
        page.RootPanel.As(B4XView).SetLayoutAnimated(0,0,0,Root.Width,Root.Height)
        lst.Add(page)
        #End If
        
    
    ASViewPagerNative1.AddPages(lst,"")

I have changed you example to create one page for now and load a Layout, that is a mapfragment only
The layout is not showing up.

and how can I change the page by code using your ASViewPagerNative?
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
and how can I change the page by code using your ASViewPagerNative?
B4X:
ASViewPagerNative1.CurrentPage = 0

Wait For B4XPage_Resize (Width As Int, Height As Int)
B4X:
#If B4i
    Wait For B4XPage_Resize (Width As Int, Height As Int)
    #End If

I have to be in the office at 1pm, I have B4A there, but no emulator, so I can't help until 9pm.
 

Attachments

  • ASViewPagerNative Example.zip
    14.3 KB · Views: 196
Upvote 0

EduardoElias

Well-Known Member
Licensed User
Longtime User
B4X:
ASViewPagerNative1.CurrentPage = 0


B4X:
#If B4i
    Wait For B4XPage_Resize (Width As Int, Height As Int)
    #End If

I have to be in the office at 1pm, I have B4A there, but no emulator, so I can't help until 9pm.

fantastic! it is working just fine on android now ! wow, many thanks for your help, really appreciate it.

Going to test on iOS now
 
Upvote 0

EduardoElias

Well-Known Member
Licensed User
Longtime User
B4X:
ASViewPagerNative1.CurrentPage = 0


B4X:
#If B4i
    Wait For B4XPage_Resize (Width As Int, Height As Int)
    #End If

I have to be in the office at 1pm, I have B4A there, but no emulator, so I can't help until 9pm.

Hey! we have a winner! Your Native vesion is working fine in both platforms and manage to work with google Maps with no problem!

I greatelly appreciate your help!
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
 
Upvote 0
Top