Syncfusion Team,
I have a control hierarchy like follows:
ContentPage [LeftPanelPage]
- SFTabs
- Tab 1
- Tab 2
- Tab 3 [contains SFChat]
- Tab 4
I am integrating above ContentPage into iOS platform'a native ViewController like
var leftPane = new LeftPanelPage().CreateViewController();
and adding this leftPane as a subview to the parentview in iOS ViewController.
Now, When orientation changes, I am assigning the required size to this left pane along with other component in the screen in iOS platform.
Everything works good as far as I do not send any message in a chat control. When in Portrait mode if I send one message, then rotate the device to landscape, the SFChat does not layout properly and hence no any other tab content lays out properly.
The chat textbox goes beneath the bottom edge of the screen and so not visible.
I have verified that the leftPane is getting its proper height and width but SFTabView and SFChat do not adopt that size.
Fyi, number of tabs are dynamic, sometimes 4 Tabs and sometimes 5 Tabs. So, I am using leftPaneTabsView.VisibleHeaderCount = leftPaneTabsView.Items.Count(i => i.IsVisible);
On my ViewController in iOS, I am also using containerViewController.AdditionalSafeAreaInsets = new UIEdgeInsets(0, 0, 20, 0);
Would you please help me in this issue? I have invested my whole day and tried lot of things but nothing works.
Please refer the attached screenshot.
Thanks,
Milan
Hi Milan,
Could you please share the code snippets of native ViewController and LeftPanelPage class. Because it will help us to prepare a sample based on your scenario.
Regards,
Karthik Raja
Karthikraja,
This is very very complex structure of project and it will be hard and time-consuming to replicate the same as a sample code.
I do not guarantee that I can do it due to heavy work load, but I will check if I can.
Meanwhile request you to keep investing and replicating from your end.
Thanks,
Milan
Syncfusion Team,
We have solved this issue using following hack. We tried to clear and reload tabs to adjust the size again and it solved the issue.
protected override void OnSizeAllocated(double width, double height)
{
base.OnSizeAllocated(width, height);
if (Device.RuntimePlatform == Device.iOS)
{
if (width != chatView.Width)
{
ReloadTabs();
}
}
}
private async void ReloadTabs()
{
// Added dealy to give view a time to reload properly, after that we can set tabs.
// Without delay tabs were not rendered properly.
await Task.Delay(20);
int selectedTabIndex = myTabView.SelectedIndex;
Syncfusion.XForms.TabView.SfTabItem[] tempItems = new Syncfusion.XForms.TabView.SfTabItem[myTabView.Items.Count];
myTabView .Items.CopyTo(tempItems, 0);
myTabView .Items.Clear();
foreach (var item in tempItems)
{
myTabView .Items.Add(item);
}
myTabView.SelectedIndex = selectedTabIndex;
}
However, this is not best approach but can think of as a solution.
Thanks,
Milan