Unplanned
Last Updated: 22 Dec 2025 06:49 by ADMIN
Mohammed Rameez
Created on: 13 Jun 2024 13:15
Category: SideDrawer
Type: Bug Report
0
SideDrawer: [iOS] Content views don't resize on rotation
1. Open the drawer, the app being in portrait mode.

2. Seen that the background is faded out.

3. Change the orientation to landscape mode.

4. ISSUE- Seen that the fade is not covering the screen fully as per the landscape view.
2 comments
ADMIN
Didi
Posted on: 22 Dec 2025 06:49

Another workaround: Invalidating some of the SideDrawer's views on opening the SideDrawer and on OnSizeAllocated. This approach solves the issue both when changing the orientation when the drawer is open and when it is not.

    protected override void OnSizeAllocated(double width, double height)
    {
        base.OnSizeAllocated(width, height);

        (this.drawer.DrawerContent as IView)?.InvalidateMeasure();
        (this.drawer.MainContent as IView)?.InvalidateMeasure();

        this.Dispatcher.Dispatch(() =>
        {
            var platformView = this.drawer?.Handler?.PlatformView as TelerikUI.TKSideDrawerView;
            if (platformView != null)
            {
                var hostView = platformView.MainView.Superview;
                if (hostView != null)
                {
                    var layer = hostView.Layer?.Sublayers?.LastOrDefault() as CALayer;
                    if (layer != null)
                    {
                        layer.Frame = new CoreGraphics.CGRect(0, 0, hostView.Frame.Width, hostView.Frame.Height);
                    }
                }
            }
        });
    }

private void OpenDrawer_Clicked(object sender, EventArgs e)
    {
        this.drawer.IsOpen = true;
        (this.drawer.DrawerContent as IView)?.InvalidateMeasure();
    }

Regards,
Didi
Progress Telerik

ADMIN
Didi
Posted on: 17 Dec 2025 07:56

Workaround:

Set the native iOS drawer header and footer height to 0:

public partial class MainPage : ContentPage
{
	RadSideDrawer drawer;
public MainPage()
	{
		InitializeComponent();
		this.drawer = new RadSideDrawer();
		this.drawer.HandlerChanged += drawer_HandlerChanged;
	}

	private void OpenDrawer_Clicked(object sender, EventArgs e)
	{
		this.drawer.IsOpen = true;
	}

	private void drawer_HandlerChanged(object sender, EventArgs e)
	{
		this.UpdateDrawer();
	}

	private void UpdateDrawer()
	{
		var platformView = this.drawer.Handler.PlatformView;

#if IOS || MACCATALYST
        var platformSideDrawer = (TelerikUI.TKSideDrawerView)platformView;
        var drawer = platformSideDrawer.SideDrawers[0];
        drawer.Style.HeaderHeight = 0;
        drawer.Style.FooterHeight = 0;
#endif
	}
}

Regards,
Didi
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.