Modal form is empty with PushModalAsync with Xamarin.Forms.Maps - xamarin

I have a form that includes a Xamarin.Forms.Maps.Map control. When I push new views onto the stack with await Navigation.PushAsync(page), views that I want to be modal (using await Navigation.PushModalAsync(page)) that I push onto the stack are empty. The animation works fine, but what's animated is just empty (the background is white but with no controls or other UI elements rendered. If I remove the map control from the "root" view, the modal pages are displayed correctly. If I use .PushAsync instead of .PushModalAsync the views are displayed correctly.
I am targeting Android 6 using the Google emulators
I have no idea what's going on.

it looks like we have a bug on the Xamarin Forms ModalNavigation. It was already reported here: https://bugzilla.xamarin.com/show_bug.cgi?id=43692
For now, I'm using this workaround (from Scott Simms): before pushing a any page (in the OnDisappearing()) from a page that contains a MapView, remove the MapView from the Content of current page, and load it again in the OnAppearing();
It works well for next page BUT... if you push a new wrapped ModalPage on this second page, when you pop it, probably it will crash your app too.
It has been bothering me, and I am thinking about implement my own toolbar to make it looks like a Navigation Page and avoid the annoying crashing.

Related

Difference between Prism Dialogs vs Popup

I am implementing Prism in a new Xamarin Forms App. I have been using Rg.Plugins.Popup in the app before converting to Prism.
What are the limitation on the Prism Dialogs vs Prism.Plugin.Popups?
What are some examples when you would use one over the other?
Thank you!
Rg.Plugins.Popup is a popular plugin for Xamarin.Forms which accesses the native functionality to provide a "Modal Popup" which traditionally has not been achievable with Xamarin.Forms.
Dialogs in Prism 7.2
If you're using Prism 7.2 you'll find that the DialogService locates the currently displayed page and then "reparent's the content". Or in other words it takes the content of the active Content Page and places it as the root child of an AbsoluteLayout, placing a mask layer and finally your dialog on top. As a result of this approach you'll notice that any navigation bars for instance on the NavigationPage or TabbedPage, or a MasterDetailPage's menu will remain accessible to the user.
While in some regard both the PopupPage and Dialog may look very similar as you can probably tell there is some significant divergence there.
Dialogs in Prism 8
If you're using Prism 8.0 you'll see that we have updated to the latest Xamarin.Forms and as a result we are able to take advantage of a new feature in Xamarin.Forms which allows you to present a Modal Page with a Transparent background. This in effect allows you to replicate the effect of a PopupPage with either some benefits or drawbacks depending on how you look at it.
With Rg.Plugins.Popups you have the ability to push a PopupPage on top of whatever page is currently displayed from anywhere in the app
With Xamarin.Forms page's that have been pushed Modally they are part of your active Navigation Stack
Using the a traditional page with a transparent background and Modal Navigation you in effect have replicated the appearance of what you get with a PopupPage
Limitations
Prism.Plugin.Popups has the benefit of being integrated into the Navigation Service. As such you can inject the Navigation Service into the ViewModel of a PopupPage, and the PopupPage will be dismissed when you navigate away from it to another non PopupPage.
Dialogs are not part of the Navigation Stack tracked by Prism's Navigation Service. Navigation in Xamarin.Forms is dependent on navigating FROM a specific page. Since Prism's NavigationService doesn't know about the Dialog you will need to dismiss the dialog before navigating.
Other Key Differences
Besides what I've mentioned so far the only real difference is that Rg.Plugins.Popup gives you some added animations which honestly I've seen very few people using.

Xamarin forms Android app verison goes blackscreen randomly

I got this app im been working on i xamarin forms. where i use a ContantPages inside a navigationspage. like shown below
MainPage = new NavigationPage(new SwipePage());
Now when i navigate to a other page like shown below, sometimes the screen goes black. If i then tap out of the app, and then tap in the app, the black screen will disappear, an the page content would be showing. making the app normally again.
this.Navigation.PushAsync(new ProfilPage());
I been trying to see if it's curse i load more data en app start, then resume. but i don't. its getting the same amount of load on resume, as on start.
So do anyone have a idea what it can be, or have tried something similar before?
Thanks for your time,
---UPDATE---
So In a emulator it runs without problems. but when i use a android device IRL it's keep doing that black screen thing.
I think this is occurring because you are not awaiting the async method thus showing a black screen as the page is still rendering but you have already been pushed to the page.
Try using the await operator.
var page = new SwipePage();
await Navigation.PushAsync(page);

WinRT Settings Charm. Elements overlayed by on screen keyboard

I'm developing for Windows 8 (WInRT) and have problem with settings charm. Settings popup is based on Microsoft SDK settings charm. Settings panel is Popup. Content is wrapped by ScrollViewer -> Grid -> StackPanel. In StackPanel I have input fields. when I trying to fill last of them on screen keyboard overlaying it and I cant see field and cant scroll to it. Is there any way to see it and to scroll to it automatically?
Seems like the popups on Windows 8 suffer from the same problem as they did on Windows Phone in that when you put a TextBox on one of them - it does not get pushed up together with all the other content as it does when it is not in a popup.
My solution to that would be to not use popup for input fields and instead go for a layout that you can manage yourself.
By default the app has a Frame control at its visual root. You can modify it for example by putting your own UserControl in there (I usually call it AppShell) which has the Frame used by all pages, you can have a layer for popups, log in screens, the extended splash screen etc.
To solve your problem you would need to put your charm's UI inside of such layer instead of in a popup. Then the build-in mechanism that pushes all the UI up when the on-screen keyboard would otherwise obstruct the view of your TextBox should just start working again.
*EDIT
A simpler solution might be to make sure your settings panel popup is parented in your visual tree - e.g. by adding it as a child element to a root grid of your app or page. It turns out that in that case its content does get pushed up when the OSK shows up.
Take a look at this post
It's a popup wrapper (turns user controls into popups) that takes care of the keyboard appearing and adjusts the size of the popup (and thus the user control) accordingly.

WebOS app not scrolling down on the main page

I have an Enyo webOS application I am developing for phones. There are several text inputs on the main page, with a button underneath them--however, the button is not viewable below the textboxes. However, there appears to be a scroll lock by default on the main scene--so I cannot scroll down and see the rest of the content.
How can I enable my app to allow for scrolling within a VFlexBox view?
Thanks!
Ah, I found it--I need to change from enyo.VFlexBox to enyo.Scroller for the view. Works fine!

How do I scroll my Palm webOS application?

This feels like a dumb newbie question. I'm attempting to follow the Palm's online tutorial for developing a webOS app. I ran palm-generate and tried updating the generated index.html file to have a body with a bunch of content (the word "HELLO" repeated 400 times).
When I attempt to load that document in the emulator, I find that I'm unable to scroll the screen to read the rest of the text. I drag the screen, but nothing happens. The page scrolls just fine in the Palm web browser.
Is there a setting to allow users to drag my app to scroll it? I see documentation for a Mojo.Widget.Scroller, but that seems like it shouldn't be necessary for a simple web page with a bunch of text on it.
Thanks to arthurthornton:
You can take anything that would normally be inside the tags and put that inside the scene HTML file.
OR you could just make a basic scene with a webview widget inside it that has your site as the source.
Unfortunately, the Scroller widget is needed for scrolling. The standard WebKit view that's shown in a card has no native scrolling ability, so the Mojo scroller widget implements the logic for displaying more content that can fit.
You can try this out by making a new project in the Ares IDE. Just add a Scroller and use the Maximize button to make it fill the scene. Then, add a HTML object to it, and add your HTML content to that object. You'll then have a nice scene which allows you to scroll through a lot of content.

Resources