B4A Library [B4X] [XUI] AS ViewPagerNative based on AHViewPager and iTabstrip

sultan87

Active Member
Licensed User
Longtime User
good evening
I would like to follow your project as an example
When compiling I got this error message

can you help me
Pierre
 

Alexander Stolte

Expert
Licensed User
Longtime User
I would like to follow your project as an example
When compiling I got this error message
Read the installation guide:
 

james_sgp

Active Member
Licensed User
Longtime User
HI, using this in a B4X app, in B4a I set the background as transparent without issues. But in B4i I have also set it transaprent, when it first appears it is correct, but after the 'resize' event the background becomes black?

Can anyone help?

Thanks, james
 

Jim2025

Member
For example, I now have 10 pages that I added with the help of the initial examples with the help of a list and now I am on page 5. Now how can I delete pages 2 and 8 so that my pages are updated?

With the help of the ASViewPager library, it would look like this
B4X:
' Current page index is 4 means page5
ASViewPager1.RemovePage(1) ' page2 index 1
ASViewPager1.RemovePage(6) ' after removed page 2 index changed so page 8 index is 6
But how do I do remove special pages number with ASViewPagerNative ?
 

Jim2025

Member

I was able to solve the problem this way, maybe it will be useful to someone.
in Class_Globals:
Dim AHPageContainer1 As AHPageContainer
in Initialize:
AHPageContainer1.Initialize
in B4XPage_Created:
    lst.Add (AddDynamicPage(xui.Color_ARGB(255,118,4,208)))
    AHPageContainer1.AddPage(lst.Get(0).As(Panel),"")
 
    lst.Add (AddCustomPage("pgtest"))
    AHPageContainer1.AddPage(lst.Get(1).As(Panel),"")
 
    lst.Add (AddDynamicPage(xui.Color_ARGB(0,255,4,208)))
    AHPageContainer1.AddPage(lst.Get(2).As(Panel),"")
    ASViewPagerNative1.NativeViewPager.PageContainer=AHPageContainer1


custom subs:
private Sub AddDynamicPage(color As Int) As B4XView

    Dim tmp_xpnl As B4XView = xui.CreatePanel("")
    tmp_xpnl.Color=color
    tmp_xpnl.SetLayoutAnimated(0,0,0,Root.Width,Root.Height)
    Return tmp_xpnl
 
End Sub

private Sub AddCustomPage(name As String) As B4XView

    Private tmp_xpnl As B4XView = xui.CreatePanel("")
    tmp_xpnl.SetLayoutAnimated(0,0,0,Root.Width,Root.Height)
    tmp_xpnl.LoadLayout(name)
    Return tmp_xpnl
 
End Sub

for delete or goto special page:
AHPageContainer1.DeletePage(0)
ASViewPagerNative1.NativeViewPager.GotoPage(2,True)
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…