Windows XAML control with CacheMode=BitMapCache shows black screen - xaml

I have a map control
< Maps:MapControl x:Name="_instiMap" CacheMode="BitMapCache" />
This shows a black screen on opening the app.
When I just have
< Maps:MapControl x:Name="_instiMap" />
the map is rendered fine. I added bitmap cache for performance improvements, since navigation transitions were lagging with map control. What do I do to enable bitmapcache and still render the map properly? If not, how can I improve map performance?

Related

Even if the content page background color is set to transparent, while using PushModelAsync to navigate the page, the background color is always black

My goal is to view the content of the bottom page from the top of the other content page. In order to accomplish this, I used PushModalAsync to navigate and set the BackgroundColor property of the navigation page to Transparent. I can view the content on the bottom page on Android. However on the iOS platform, a black color is always displayed and I am unable to read the content of the bottom page. Why is the background color always black even when it is set to be transparent in PushModalAsync?
Note: The iOS platform displays a white screen when I change the navigation to PushAsync.
Expected Behavior:
Background color should not be black and it should be transparent when navigating using PushModalAsync
Actual Behavior:
Background color is always black even when the content page background color is set as transparent when navigating using PushModalAsync
Android Screenshot
iOS Screenshot
The issue reproducing sample is provided below:
DemoSample
If you want to do EXACTLY like that, it is not possible (it will require so much work that you can't expect someone to provide you the solution here).
On iOS that control (ViewController) is drawn that way in that presentation mode. So as long as you use that control and that mode it will work that way irrelevant if you use Xamarin or something else. As ViewControllers are most basic controls it is not realistic to replace them with something else. But you can replace presentation mode. In Xamarin.Forms you can do that this way:
<ContentPage ...
xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
ios:Page.ModalPresentationStyle="FormSheet">
...
</ContentPage>
This will result in somewhat different visual presentation but that is the only way to have one ViewController drawn over another without going into some deep customization that would require tons of code, especially on Xamarin.Forms.
You can also try some other values, but the default value will not work.
In iOS, the hierarchy is managed by the view controller. Each page has a separate view controller. A page consists of a window, a root view, and a subview. You cannot see the layout of the previous page by setting the background color to be transparent.
For more details, you can refer to the following documents:
User interface | Microsoft
The View Controller Hierarchy | Apple

Overlay the whole AppBar on the page content in windows phone 8.1

When app bar is present, the height of the app bar affects the content on the rest of the page.
For example, if the app bar has a Height of about 25px when ClosedDisplayMode="Minimal", the rest of the content on the page (rootGrid) would have its actual height of Screen Height - 25px. So the app bar is not overlay on page content.
This is visible especially when the content is VerticalAlignment="Center" or Bottom.
Is there any way to avoid this? Something like a ZIndex on the AppBar so that it is displayed over the page content and not trimming it on the bottom side of the screen.
It is possible to tell the renderer that the whole "window" should be used when rendering and not just the visible part. By calling Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().SetDesiredBoundsMode(ApplicationViewBoundsMode.UseCoreWindow) the renderer will include the areas beneath the chrome of the window (ie the system tray on top of the screen and the app bar at the bottom). The chrome will always be on top of whatever is rendered from xaml.
ApplicationView is documented here.
If you don't want the system tray on the top of the screen to overlap the content, you'll have to compensate with a margin on the root container of your visible xaml.

Windows Phone 8.1 Create a Swipeable Scrollable Control

I am trying to create an animation to a control.
So think of the animation and control of a now playing page on most touch screen devices. You see the control (album photo) and swipe either way and get it to slide off the screen and then the next control (album photo) slides on in its place.
I am not asking for you to code me this, but I am having trouble wrapping my head around a way that this could be done.
The control content is always changing, when you swipe one way, an image is removed from the view and then the next is added.
What you need is FlipView control which can get you the interface you described.
Here are some references:
Quickstart: Adding FlipView controls (XAML)
XAML FlipView control sample

Titanium JS: How to stop a generated list view from appearing underneath the keyboard

I have a window in my Titanium Alloy app which has a search bar. After submit the server returns a JSON feed which is then used to build a list view in the area underneath it.
The problem I have is that the list view takes up the whole space of the screen and a portion of it appears underneath the keyboard.
I could set a height on that list view, however I feel that this is not platform agnostic. The height for an iPhone 5 may differ than that of an Android device.
How can I ensure that the list view generated does not show up underneath the keyboard? Is there a clean, multi-platform way of doing this?
<Alloy>
<Window layout="vertical">
<SearchBar id="searchBar" hintText="Search all shows" showCancel="true" />
<!-- List view added here will not
show underneath the search bar -->
</Window>
</Alloy>
I just had to implement the same thing, but was not able to do so in a cross platform way.
For iOS i used a combination of Ti.App.keyboardFrameChanged with Ti.App.keyboardVisible. Set the functions to adjust the height of the listview.
For android i put a touchstart event on the first/main view of the template. When touched, hides the keyboard. iOS didn't always want to fire off this event if the listview started scrolling TOO quickly. Android worked just fine. Trying to put a touchstart event on the listview itself failed in every case.

Different splash screen image for snapped view on Win8 store app

I have defined the image in package.appxmanifest with
<SplashScreen Image="foo.png" BackgroundColor="#000000" />
but is it possible to define alternative image for snapped view?
No, it's not possible.
But you can create "fake splashscreen page" that will be basically your page where you can put display one image for Fullscreen mode and other image for SnapView mode.
Similar behavior uses for instance the Store app where the actual splashscreen is shown only for a second and then you see page with green background, logo and ProgressRing.