Getting the View from the Tab

Okay, I feel like I’m missing something. I’ve created an iOScreen with two tabs, each with their own view. Programmatically, can I access the view that is created for tab 0 and 1? If so, how?

It isn’t possible out of the box.

But it is fairly easy to do.

  1. Create a subclass of iOSTabBar with one property Views() as iOSView
    And one method

[code]Public Sub AddTab(content As iOSTabContent)
Super.AddTab(content)

views.Append iOSView(content)
End Sub
[/code]

  1. Add a property to App
myTabs as myCustomTabBar

And a method

[code]Public Sub ShowUI()

myTabs = New myiOSTabBar

Dim v1 As New View1
v1.TabTitle = “View 1” //optional
v1.TabIcon = icon1 //optional
myTabs.AddTab(v1)

Dim v2 As New View2
v2.TabTitle = "View 12
v2.TabIcon = icon2
myTabs.AddTab(v1)

App.CurrentScreen.Content = myTabs
End Sub

[/code]

  1. Add an empty view to the project let’s call it vSplash
    In the Activate event call this code:
App.ShowUI
  1. Set your iPhoneScreen content to vSplash

You can now call App.myTabs.Views(0) to get access to the view on the first tab

I’m kind of surprised that programmatically we can’t get the views that are in each tab. Perhaps that’s the limitation of having the iOSScreens concept.