Unplanned
Last Updated: 04 Oct 2023 07:55 by Jiri
Jiri
Created on: 03 Oct 2023 12:55
Category: TabView
Type: Bug Report
0
TabView: Content is misplaced when adding tab using index and one of the tabs is hidden

Steps to reproduce

- open QSF.sln

- open WorldClockView.xaml

- add x:Name="tabView" to RadTabView

- add IsVisible="False" to Auckland tab item !!!

- open WorldClockView.cs

- add this code to the end of page constructor:

 var tabItem = new TabViewItem()
 {
     Header = new TabViewHeaderItem { Text = "Prague" },
     Content = new StackLayout
     {
         Children =
         {
             new Label {Text = "Prague"}
         }
     },
 };
 var index = tabView.Items.Count - 2;
 tabView.Items.Insert(index, tabItem);
The content for Prague header is the content from different tab.

 

 

 

1 comment
Jiri
Posted on: 04 Oct 2023 07:55

workaround - create invisible tab and make it visible after inserting to tab view

var tabItem = new TabViewItem()

 {
     Header = new TabViewHeaderItem { Text = "Prague" },
     Content = new StackLayout
     {
         Children =
         {
             new Label {Text = "Prague"},
         }
     },
     IsVisible = false
 };
 var index = tabView.Items.Count - 2;
 tabView.Items.Insert(index, tabItem);
 tabItem.IsVisible = true;