Rotating Device after sending one message, does not auto size the views - SFChat, SFTabView

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



Attachment: SFChatResizeIssue_2dc6a03b.zip

6 Replies

KK Karthikraja Kalaimani Syncfusion Team July 19, 2021 01:28 PM UTC

Hi Milan, 

Currently, we are validating the reported issue. We will validate and update the further details on or before 21st July 2021. We appreciate your patience until then. 

Regards,
Karthik Raja



KK Karthikraja Kalaimani Syncfusion Team July 21, 2021 07:40 AM UTC

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



MG Milan Gohil July 21, 2021 07:44 AM UTC

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



KK Karthikraja Kalaimani Syncfusion Team July 22, 2021 04:09 PM UTC

Hi Milan,

Thanks for the update. We will keep investing to reproduce the issue and update the details once we reproduced the issue in our end. We appreciate your patience until then. 

Regards,
Karthik Raja


MG Milan Gohil August 19, 2021 05:27 AM UTC

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



KK Karthikraja Kalaimani Syncfusion Team August 20, 2021 06:27 AM UTC

Hi Milan, 

Thanks for the update.

We glad to know that the reported issue has been resolved at your end. Please let us know if you need further assistance from us. 

Regards,
Karthik Raja

Loader.
Up arrow icon