popup not working in iOS

hello, am using a popup layout in the android and iOS side 
In android, it is working fine
but in the iOS side app crashes while clicking on button click event

code - 

void PublicBtnClicked(object sender, EventArgs e)
        {
            VisibilityPopup.Show();

        }

 <sfPopup:SfPopupLayout x:Name="VisibilityPopup">
                            <sfPopup:SfPopupLayout.PopupView>
                                <sfPopup:PopupView x:Name="popupview" AutoSizeMode="Height" ShowFooter="False" HeaderTitle="Change Visibility">
                                    <sfPopup:PopupView.PopupStyle>
                                        <sfPopup:PopupStyle HeaderBackgroundColor="White"
                                    HeaderFontAttribute="Bold"
                                    HeaderFontFamily="Cabin"
                                    HeaderFontSize="16"
                                    HeaderTextAlignment="Center"
                                    HeaderTextColor="Black"/>
                                    </sfPopup:PopupView.PopupStyle>
                                    <sfPopup:PopupView.ContentTemplate>
                                        <DataTemplate>
                                            <StackLayout Padding="5,5,5,0">
                                                <Label x:Name="visibilityTXT" Text="Once you change from public to &#10; private, all post will only be visible to &#10; your followers." FontFamily="Cabin" FontSize="16"  HorizontalTextAlignment="Center" TextColor="#262626"
                            BackgroundColor="White"
                            LineBreakMode="WordWrap"/>

                                                <buttons:SfButton x:Name="StayPublicBtn" FontFamily="Cabin" Text="STAY PUBLIC" TextColor="White" CornerRadius="5" HeightRequest="60" IsCheckable="True" PressedBackgroundColor="White" Clicked="StayPublicBtnClicked" Margin="10,2,10,10">
                                                    <buttons:SfButton.BackgroundGradient>
                                                        <gradient:SfLinearGradientBrush>
                                                            <gradient:SfLinearGradientBrush.GradientStops>
                                                                <gradient:SfGradientStop Color="#650486" Offset="0"/>
                                                                <gradient:SfGradientStop Color="#9900CC" Offset="1"/>
                                                            </gradient:SfLinearGradientBrush.GradientStops>
                                                        </gradient:SfLinearGradientBrush>
                                                    </buttons:SfButton.BackgroundGradient>
                                                </buttons:SfButton>

                                                <buttons:SfButton x:Name="GoPrivateBtn" FontFamily="Cabin" Text="GO PRIVATE" TextColor="#9900CC" CornerRadius="5" HeightRequest="60" IsCheckable="True" PressedBackgroundColor="White" Clicked="GoPrivateBtnClicked" BorderColor="#9900CC" BorderWidth="1" Margin="10,2,10,10">
                                                    <buttons:SfButton.BackgroundGradient>
                                                        <gradient:SfLinearGradientBrush>
                                                            <gradient:SfLinearGradientBrush.GradientStops>
                                                                <gradient:SfGradientStop Color="White" Offset="0"/>
                                                                <gradient:SfGradientStop Color="White" Offset="1"/>
                                                            </gradient:SfLinearGradientBrush.GradientStops>
                                                        </gradient:SfLinearGradientBrush>
                                                    </buttons:SfButton.BackgroundGradient>
                                                </buttons:SfButton>

                                            </StackLayout>
                                        </DataTemplate>
                                    </sfPopup:PopupView.ContentTemplate>
                                </sfPopup:PopupView>
                            </sfPopup:SfPopupLayout.PopupView>
                        </sfPopup:SfPopupLayout>

5 Replies

KK Karthikraja Kalaimani Syncfusion Team September 28, 2020 01:47 PM UTC

Hi Shraddha,

We have checked the reported issue with the code snippet. Unfortunately, we could not able to reproduce the issue in our end and it is working fine as expected in Xamarin forms iOS platform. We have attached the tested sample for your reference.

Sample link : https://www.syncfusion.com/downloads/support/directtrac/general/ze/Popup_Demo_2-758335303.zip

 

Please check the sample and let us know if you still facing the same issue? If not, please modify the sample based on your scenario and revert us back.

Regards,
Karthik Raja 



SP Shraddha Patange October 5, 2020 08:25 AM UTC

thank you for this sample code
surprisingly, this code is working on the iOS side but the same code I incorporated in my project, and again its throwing error at main.cs file in the iOS project
I also share the snippet of the error.
Please have a look

Attachment: maincs_9b0b8ddc.zip


KK Karthikraja Kalaimani Syncfusion Team October 6, 2020 06:18 AM UTC


Hi Shraddha,

Thanks for the update. We suspect that you have not initialized the renderer for SfPopuplayout. So only the issue occurs when showing the popup in your side. We request you to initialize the Renderer for the SfPopupLayout in iOS project. For more details, please refer to the below UG.

UG link : https://help.syncfusion.com/xamarin/popup/getting-started#ios

Regards,
Karthik Raja



SP Shraddha Patange October 6, 2020 07:41 AM UTC

Thanks for your constant support but I also initialize the SfPopupLayout renderer in my app delegate here is the code
but no wonder why this is not working 

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using CarouselView.FormsPlugin.iOS;
using FFImageLoading;
using FFImageLoading.Forms.Platform;
using Foundation;
using Serena.Data;
using Syncfusion.ListView.XForms.iOS;
using Syncfusion.SfBusyIndicator.XForms.iOS;
using UIKit;
namespace Serena.iOS
{
    // The UIApplicationDelegate for the application. This class is responsible for launching the 
    // User Interface of the application, as well as listening (and optionally responding) to 
    // application events from iOS.
    [Register("AppDelegate")]
    public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
    {
        //
        // This method is invoked when the application has loaded and is ready to run. In this 
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            //syncfusion key
            Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("MjgxNzQyQDMxMzgyZTMyMmUzMG9tSFhmYjVqak9DNzlyQnZpNjBVVHJkT1FXdURDdlhsMTIyQVQ4Rk1CQU09");
            global::Xamarin.Forms.Forms.Init();
            global::Xamarin.Auth.Presenters.XamarinIOS.AuthenticationConfiguration.Init();
            Xamarin.FormsMaps.Init();

            //NuGet Initializations for carousel view
            //CarouselViewRenderer.Init();
            //CachedImageRenderer.Init();
            //var config = new FFImageLoading.Config.Configuration()
            //{
            //    MaxMemoryCacheSize = (int)(NSProcessInfo.ProcessInfo.PhysicalMemory * 0.0001d),
            //    ClearMemoryCacheOnOutOfMemory = true,
            //    DiskCacheDuration = TimeSpan.FromSeconds(2)
            //};
            //ImageService.Instance.Initialize(config);

            #region syncfusion tools
            new Syncfusion.SfAutoComplete.XForms.iOS.SfAutoCompleteRenderer();
            new SfBusyIndicatorRenderer();
            SfListViewRenderer.Init();
            new Syncfusion.SfNavigationDrawer.XForms.iOS.SfNavigationDrawerRenderer();
            Syncfusion.XForms.iOS.PopupLayout.SfPopupLayoutRenderer.Init();
            Syncfusion.XForms.iOS.TabView.SfTabViewRenderer.Init();
            Syncfusion.XForms.iOS.Buttons.SfButtonRenderer.Init();
            new Syncfusion.XForms.iOS.ComboBox.SfComboBoxRenderer();
            Syncfusion.XForms.iOS.Border.SfBorderRenderer.Init();
            #endregion

            LoadApplication(new App());
            return base.FinishedLaunching(app, options);
        }
        public override bool OpenUrl(UIApplication app, NSUrl url, NSDictionary options)
        {
            // Convert NSUrl to Uri
            var uri = new Uri(url.AbsoluteString);

            // Load redirectUrl page
            AuthenticationState.Authenticator.OnPageLoading(uri);

            return true;
        }
    }
}



KK Karthikraja Kalaimani Syncfusion Team October 7, 2020 02:19 PM UTC

 Hi Shraddha,

It is possible to reproduce the issue in simple sample ?. If, not please share full call stack details to proceed further.

Regards,
Karthik Raja   


Loader.
Up arrow icon