iOS Question How to find B4XView on the Page.Rootpanel

Alex_197

Well-Known Member
Licensed User
Longtime User
Hi all.

I'm using B4xView TabStrip where I put 7 pages. Each page has a CLV.
Each CLV has a list of B4XSwitch - this is a schedule for each day of week.

So the Tabstrip has days of week like M T W and so on and each day of week has up to 3 B4XSwitch with labels- label shows start and finish hours.

Then I created a page in my code

B4X:
Private Sub pgCase_Appear
    Try
        TabPages.Initialize
       
        pgSun.Initialize("pgSun")
        pgSun.RootPanel.LoadLayout("DayInfo")
        pgSun.Title="S"
        lblSunday.Text="Sunday"
        TabPages.Add(pgSun)
       
        pgMon.Initialize("pgMon")
        pgMon.RootPanel.LoadLayout("DayInfo")
        pgMon.Title="M"
        lblMonday.Text="Monday"
        TabPages.Add(pgMon)
       
        pgTue.Initialize("pgTue")
        pgTue.RootPanel.LoadLayout("DayInfo")
        pgTue.Title="T"
        lblDayName.Text="Tuesday"
        TabPages.Add(pgTue)
       
''''''''''''' and so on
        tsSchedule.SetPages(TabPages)

    Catch
        Log(LastException)
    End Try
End Sub

Now I want to add B4XSwitches into each CLV on each page. Some kind of Russian doll.

My problem is here

B4X:
For p=0 to TabPages.size-1
 
   dim CurrentPage as Page, clv as CustomListView

   CurrentPage=TabPages.Get(p)

   clv=pg.RootPanel.GetView(0) ' here is a problem - Types do not match

Next

How to fix it?
 

Alex_197

Well-Known Member
Licensed User
Longtime User
Thanks for your reply.
It doesn't work - tag returns an empty string. If I open .bil file and put something into CLV tag like a string "Here Is a tag" all I can see in clv is this string.
 
Upvote 0

Alexander Stolte

Expert
Licensed User
 
Upvote 0

Alex_197

Well-Known Member
Licensed User
Longtime User
Thanks but it doesn't help me to get to the CLV on the first place. CLV is on page root panel.
This code shows hw to pull items from the CLV,

And this code is ofr Android, I need it for iOS.
 
Upvote 0

Alexander Stolte

Expert
Licensed User
And this code is ofr Android, I need it for iOS.
The "B4X" in the title says that it is a cross-platform solution. So it works on IOS too.

You are lucky (must be because of the name) I had exactly the same question in 2021 and Erel gave me the solution
 
Upvote 0
Top