RadSideDrawer content when pulled out it shows gap un top and bottom in IOS, whereas it has no gap in Android

1 Answer 52 Views
SideDrawer
Mohammed Rameez
Top achievements
Rank 1
Iron
Mohammed Rameez asked on 10 Jun 2024, 12:49 PM

Hi Team,

Recently in IOS I found that the RadSlideDrawer content when pulled out it has gap on the top and bottom in IOS, as shown in below image:

The same code when deployed in Android it has no gap.

 

1 Answer, 1 is accepted

Sort by
0
Didi
Telerik team
answered on 10 Jun 2024, 01:48 PM

Hi Mohammed,

This is a behavior of the native iOS SideDrawer control. The control has header and footer area in the drawer content. We have this logged: https://feedback.telerik.com/maui/1610383-sidedrawer-ios-provide-an-option-to-remove-header-and-footer-area-in-the-drawer-content 

Solution. Subscribe to the SideDrawer.HandlerChanged and set the native iOS drawer header and footer height to 0.

Xaml:

   
    <telerik:RadSideDrawer x:Name="drawer" HandlerChanged="drawer_HandlerChanged"
                       DrawerLength="200">
        <telerik:RadSideDrawer.MainContent>
            <Grid>
                <Label Text="Main content" />
            </Grid>
        </telerik:RadSideDrawer.MainContent>
        <telerik:RadSideDrawer.DrawerContent>
            <VerticalStackLayout Spacing="10"
                             Padding="10, 10, 0, 0">
                <Button Text="Mail" />
                <Button Text="Calendar"/>
                <Button Text="People" />
                <Button Text="Tasks" />
            </VerticalStackLayout>
        </telerik:RadSideDrawer.DrawerContent>
    </telerik:RadSideDrawer>

 

Xaml.cs

public partial class MainPage : ContentPage
{
    public MainPage()
    {
        InitializeComponent();
    }

    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.

Mohammed Rameez
Top achievements
Rank 1
Iron
commented on 12 Jun 2024, 08:54 AM

Hi Didi,

 

Thanks for the reply, the solution works fine.

 

Regards,

Mohammed Rameez Raza (Rameez).

Mohammed Rameez
Top achievements
Rank 1
Iron
commented on 12 Jun 2024, 01:22 PM | edited

Hi Didi,

 

There is one more issue observed in IOS with the Drawer, that is listed below:

 

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.

Didi
Telerik team
commented on 13 Jun 2024, 01:18 PM

I have logged the behavior on your behalf here: https://feedback.telerik.com/maui/1655241-sidedrawer-ios-content-views-don-t-resize-on-rotation

I am afraid there isn't a workaround I can suggest for this behavior.

 
Tags
SideDrawer
Asked by
Mohammed Rameez
Top achievements
Rank 1
Iron
Answers by
Didi
Telerik team
Share this question
or