iOS:Screen is not updating its size after changing portrait to landscape and vice-versa orientation in iOS (iPad, iPhone) using Xamarin.forms

V G 0 Reputation points
2023-08-10T07:21:38.61+00:00

Packages 

-Xamarin.Forms(5.0.0.2291)

-Xamarin.Community.Toolkit(2.0.4)

 

Controls

  • xct:TabView

 

Expected Behavior

-xct:Tabview items should automatically update its layout to match the device orientation changes.

-When orientation is changed from portrait to landscape (or vise versa) height and width of its child controls  should automatically be adjusted.

 

Actual behavior -for android app: Working as expected.

 

Expected behavior -for iOS app: xct:Tabview Item does not update width and height when switching orientation between portrait and landscape  when we rotate the device, the tab view is  messed up . Also contents of multiple tabs are overlapped.

 

What we tried?

-We have Handled Orientation Changes in  OnSizeAllocated event on the tab page's.

-We have used SizeChanged method, which is rising when we are rotating device.

-In size change event we tried ‘ForceLayout’ method  but it didn’t help

-In the iOS project settings’,  Info.plist file we have check Supported interface orientations (iPad) and Supported interface orientations (iPhone) keys.

 

*Note: This problematic  behavior is for all the TabViews Page  in the Project

Portrait View

PortraitMode

Landscape ViewLandscapeMode

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,378 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,407 questions
XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
842 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.