We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

NavigationDrawer and ContentPresenter iOS problem


I have a problem when I use SfNavigationDrawer in a application level ControlTemplate with a ContentPresenter.

More exactly my App.xaml looks like this:

<Application xmlns="http://xamarin.com/schemas/2014/forms"
            <ControlTemplate x:Key="MyTemplate">
                <navigationdrawer:SfNavigationDrawer x:Name="navigationDrawer" DrawerHeaderHeight="160">
                        <Grid x:Name="mainContentView" BackgroundColor="White">
                                <RowDefinition Height="auto"/>
                            <StackLayout BackgroundColor="#1aa1d6" Orientation="Horizontal">
                                <Button x:Name="hamburgerButton" HeightRequest="50" WidthRequest="50" HorizontalOptions="Start" FontSize="20" BackgroundColor="#1aa1d6"/>
                                <Label HeightRequest="50" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" Text="Home" FontSize="16" TextColor="White" BackgroundColor="#1aa1d6"/>

                            <ContentPresenter Grid.Row="1" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"></ContentPresenter>
                            <Label Text="James Pollock" Grid.Row="1" HorizontalTextAlignment="Center" HorizontalOptions="Center" FontSize="20" TextColor="White"/>
                        <Label HeightRequest="50" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" 
                               Text="Drawer Content View" FontSize="16" TextColor="White" BackgroundColor="#1aa1d6"/>

The ContentView part of  SfNavigationDrawer contains a ContentPresenter that should be populated with content at runtime.
My main page (the content I wanna put into ContentPresenter) looks like this:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"

    <ContentView x:Name="contentView" Padding="0,20,0,0"
                 ControlTemplate="{StaticResource MyTemplate}" BackgroundColor="AliceBlue">
        <StackLayout VerticalOptions="CenterAndExpand" BackgroundColor="Red">
            <Label Text="Main Page" HorizontalOptions="Center" />


Normally, the content of MainPage.xaml wil be loaded into that ContentPresenter from the ControlTemplate. On Android this happens but on iOS NOT. On iOS everything gets displayed except the ContentPresenter. 

For installation and config parts of the SfNavigationDrawer control I basically followed the documentation page https://help.syncfusion.com/xamarin/sfnavigationdrawer/overview.

It may be a bug of the control or I dont know. Any help or suggestions will be appreciated. 

For testing I used:
iPhone 7 simulator with iOS 10.3
Xamarin.Forms version=""
Syncfusion.Xamarin.SfNavigationDrawer.IOS version=""
Syncfusion.Xamarin.SfNavigationDrawer version=""

Thank you!

5 Replies

VA Vanaja  Annasamy Syncfusion Team July 17, 2017 12:41 PM UTC

Hi Matei,

A support incident to track the status of this defect has been created under your account.

Please log on to our support website to check for further updates.

Link: https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents/    

Vanaja R.A.

TH Thanh March 19, 2018 09:32 PM UTC

Can I have an update for this?

RB Rabhia Beham Kathar Mideenar Syncfusion Team March 20, 2018 12:14 PM UTC

Hi Thanh,

We have prepared a workaround sample with SfNavigationDrawer Control to display the ContentPresenter in iOS.Please have the sample from the below link.

Sample Link: http://www.syncfusion.com/downloads/support/forum/131502/ze/NavigationDrawer_contentpresent_workaround-1658146581 

Please let us know if you have any concern.

Rabhia Beham K. 

TH Thanh March 20, 2018 01:08 PM UTC

Thanks Rabhia. I think I misread the question. My question is the opposite: Put the controlTemplate inside the ContentView of sfNavigationDrawer not working. 

RB Rabhia Beham Kathar Mideenar Syncfusion Team March 22, 2018 12:41 PM UTC

Hi Thanh,

We have analysed your requirement and prepared a sample with SfNavigationDrawer Control. We could not able to reproduce from our side. Please have the sample from the below link.

Sample Link: http://www.syncfusion.com/downloads/support/forum/131502/ze/NavigationDrawer131502-1345023586 

If the issue get reproduced at your end, please update us with modified sample and with replication steps to reproduce the issue and also in which platform the issue is getting reproduced at your end.This could help us to provide better solution on this.

Please let us know if you have any concern.

Rabhia Beham K.


Live Chat Icon For mobile
Up arrow icon