# Add split view to tab at runtime

**URL:** <https://forum.xojo.com/t/add-split-view-to-tab-at-runtime/65689>\
**Category:** iOS\
**Created:** [September 22, 2021, 2:47am UTC](https://forum.xojo.com/t/add-split-view-to-tab-at-runtime/65689 "2021-09-22T02:47:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason\_Tait](https://forum.xojo.com/user_avatar/forum.xojo.com/jason_tait/32/5896_2.png) [@Jason\_Tait](https://forum.xojo.com/u/Jason_Tait)\
**Post date:** [September 22, 2021, 2:47am UTC](https://forum.xojo.com/t/add-split-view-to-tab-at-runtime/65689/1 "2021-09-22T02:47:45Z")

</div>

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:

```auto
// 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?
