![]() ![]() Then in ViewDidLoad method, I will check only when IsDesignTime is false, I will run the code. By default it is set to true and it will set to false when called into FinishedLaunching method in AppDelegate. I have defined a boolean IsDesignTime in AppDelegate.cs. Attempt 1: Do not run code in ViewDidLoad during design time This is the reason why there is NullReferenceException when render. In the ViewDidLoad method, I have some code that is dependency injection which is not available during design time. In this mode, all custom view is not rendered.Ĭhecking in the log files and you might get the following errors: System.NullReferenceException: Object reference not set to an instance of an objectĪt +c_async5.MoveNext () in /Users/builder/data/lanes/4470/6c2f6737/source/md-addins///IPhoneDesignerSession.cs:774 Reasons & SolutionsĪfter checking into the log file, found out that the UI Designer actually call into UIViewController‘s (those that defined in the storyboard/xib) ViewDidLoad method. Problem 2: UI Designer took very long time to load and not able to render custom viewĪfter UI Designer is startup, it will show a warning bar at the top. There are many different errors but this is the most common error: System.NullReferenceException Return base.Recently when trying to open iOS UI Designer to edit storyboard/xib file, I have encounter some problems. This issue is also reported in Xamarin BugZilla: Problem 1: ViewControler is rendered but with error exclamation mark If (deBounce.AddMilliseconds(200) > DateTime.Now) } protected override OnPopViewAsync( page, bool animated) Namespace Ĭlass MyNavigationPageRenderer : NavigationRenderer Just change your namespaces and away we go! I don't have iOS running yet for my app but with android I just created a custom renderer that de-bounces the popasync method. User40009 Hey here's a work around for the double click issue. Having some sort of workaround for this would be very useful. ![]() disable it for ~0.5 seconds) after each time it is clicked, I would love to hear it. I can't create anything similar on iOS, but this may simply be because the back button can't be spammed in the same way due to iOS's animations.Īs one last note, if anyone knows a way to throttle the back button (i.e. I've attached a small example application that creates this problem. If there is anywhere I could file this issue, I would be happy to, but I was somewhat confused by the Xamarin Bugzilla site. having three pages on the stack, and triple clicking the back button seems to take you to the root page correctly. Quickly tap the back button on the ActionBar at least twice.Ĭreating additional pages seems to mitigate this issue, i.e. (More or fewer pages will does not SEEM to cause this problem) Push exactly two new pages onto the NavigationPage stack using the Navigation property's PushAsync method. So I believe I have discovered a bug in the NavigationPage class, which as far as I can tell exists only for Android, but it's possible it's just not possible to reproduce in iOS because of the way iOS animates transitions between pages.Īnyway, the issue can be reproduced as follows:Ĭreate an AndroidActivity, and a NavigationPage with some ContentPage as the root of the NavigationPage.Ĭall the AndroidActivity's SetPage method and give it the navigation controller.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |