Add split view to tab at runtime

I create my tab interface at runtime because my users can hide/show/reorder tabs. I do it by instantiating a new iOSTabBar and calling the AddTab method, passing in a particular MobileScreen for each tab. Once I’ve added al the tabs, I assign the iOSTabBar instance to App.CurrentLayout.Content. That all works well.

But now I want to implement split views on iPad. Looking at the class structure, it seems as though I should be able to create a new iOSSplitView, assign a MobileScreen to the Master and Detail properties and then call iOSTabBar.AddTab and pass it the iOSSplitView instead of a MobileScreen. However that does not result in any tabs being created.

Here’s a simplified version of what I’m doing:

// Create a tab bar
Var tabBar As New iOSTabBar

// Create views
Var masterView As MobileScreen = New myMasterView
Var detailView As MobileScreen = New myDetailView

// Create a split view
If iOSSplitView.Available Then
  
  // Create a split view
  Var splitView As New iOSSplitView
  
  splitView.Master = masterView
  splitView.Detail = detailView
  
  // *** This doesn't create a tab ***
  
  // Add split view to tab bar
  tabBar.AddTab(splitView)
  
Else
  
  // *** This creates a tab ***
  
  // Add view to tab bar
  tabBar.AddTab(masterView)
  
End If

// Add tab bar to screen content
App.CurrentLayout.Content = tabBar

What am I doing wrong?

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.