- Home
- Forum
- Xamarin.Forms
- NavigationDrawer and ContentPresenter iOS problem
NavigationDrawer and ContentPresenter iOS problem
Hi
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"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:navigationdrawer="clr-namespace:Syncfusion.SfNavigationDrawer.XForms;assembly=Syncfusion.SfNavigationDrawer.XForms"
x:Class="NavDrawer.App">
<Application.Resources>
<ResourceDictionary>
<ControlTemplate x:Key="MyTemplate">
<navigationdrawer:SfNavigationDrawer x:Name="navigationDrawer" DrawerHeaderHeight="160">
<navigationdrawer:SfNavigationDrawer.ContentView>
<Grid x:Name="mainContentView" BackgroundColor="White">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<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"/>
</StackLayout>
<ContentPresenter Grid.Row="1" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"></ContentPresenter>
</Grid>
</navigationdrawer:SfNavigationDrawer.ContentView>
<navigationdrawer:SfNavigationDrawer.DrawerHeaderView>
<Label Text="James Pollock" Grid.Row="1" HorizontalTextAlignment="Center" HorizontalOptions="Center" FontSize="20" TextColor="White"/>
</navigationdrawer:SfNavigationDrawer.DrawerHeaderView>
<navigationdrawer:SfNavigationDrawer.DrawerContentView>
<Label HeightRequest="50" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"
Text="Drawer Content View" FontSize="16" TextColor="White" BackgroundColor="#1aa1d6"/>
</navigationdrawer:SfNavigationDrawer.DrawerContentView>
</navigationdrawer:SfNavigationDrawer>
</ControlTemplate>
</ResourceDictionary>
</Application.Resources>
</Application>
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"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:NavDrawer"
x:Class="NavDrawer.MainPage">
<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" />
</StackLayout>
</ContentView>
</ContentPage>
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="2.3.4.247"
Syncfusion.Xamarin.SfNavigationDrawer.IOS version="15.2.0.46"
Syncfusion.Xamarin.SfNavigationDrawer version="15.2.0.46"
Thank you!
SIGN IN To post a reply.
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/
Regards,
Vanaja R.A.
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/
Regards,
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
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.
Regards,
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
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.
Regards,
Rabhia Beham K.
SIGN IN To post a reply.
- 5 Replies
- 4 Participants
-
MI Matei Ionut Alexandru
- Jul 13, 2017 10:35 AM UTC
- Mar 22, 2018 12:41 PM UTC