Xamarin.Forms UWP Application doesn't work on XBOX as native - xamarin

I have tried my UWP app on XBOX one which is built using xamarin.forms and it works generally fine but by default mouse mode is active. I changed it using
RequiresPointerMode = Windows.UI.Xaml.ApplicationRequiresPointerMode.WhenRequested;
on UWP level in app.xaml.cs and it disabled mouse pointer but problem is that using game pad, i am not able to select items on the UI. I can navigate through textbox and buttons but not Toolbar (Commandbar in uwp), ListView, Masterdetail, Tabs etc.
I created a blank native UWP application and added a commandbar with AppBarButtons and NavigationView with NavigationViewItems. It perfectly works, I am able to navigate between menu items and commanbaritems using mouse pad.
Why this is not working for Xamarin.Forms? is xamarin.forms not actually native for UWP?

Xamarin.Forms MasterDetailPage was written before NavigationView existed and it doesn't use it at all (and especially not with NavigationViewItems, that would limit the flexibility, i don't think it will ever be used).
As SplitView has some focus bug that I can confirm it doesn't come as a surprise that it doesn't work with XBox as expected. However UWP doesn't grant that the app will work properly when you disable the mouse mode with native controls, that's why it is enabled by default. There are properties like XYFocusLeft that must be set if the app is not working properly. You probably need to make custom renderer to expose those properties and set them right. That's pretty much of work to do but it is up to you to decide...

Related

How to make Sure Keyboard is not placed over an Entry when it is focused in Xamarin?

I have an Entry which is placed in a ContentView, and this ContentView is placed in a Grid. When this Entry is Focused, the Keyboard is placed over the ContentView preventing the user from seeing the Entry.
I would like to know if there is a way to determine if a View is Visible and if not make sure it is (prevent the Keyboard from being placed over it).
Any thoughts on how I could do this.
I would need this to work on iOS specifically, Android and Windows seem not to have this issue in my use-case.
On Android platform, the official document provides Soft Keyboard Input Mode. Refer to https://learn.microsoft.com/en-us/xamarin/xamarin-forms/platform/android/soft-keyboard-input-mode for details.
On IOS platform, you can query KeyboardOverlap installation in IOS's nuget, and then add KeyboardOverlapRenderer.Init (); in AppDelegate to achieve the effect in IOS.

Xamarin forms iOS default mail app Behavior

As per the requirement of the project I need to have the page which should behave as the default Apple Mail app on the iPhone.
Attaching a gif that I have created for the same.
I tried using the plug in https://github.com/rotorgames/Rg.Plugins.Popup
but I couldn't achieve the exact same behavior where the background shrinks and expands as the modal pop up is dragged.Any leads, examples or demos will be really helpful.
Note: I am using Xamarin.Forms.
With the new Xamain Forms update. i.e. after iOS13
The model behavior has became the default model behavior for Xamarin iOS.
When you do.
Navigation.PushModalAsyn(<your_page_here>).
It gives the above (gif) behavior.

Difficulty while writing custom renderer for navigation drawer(MasterDetailPage) xamarin.forms

I am using xamarin.forms mvvm light architecture and targeting Android & iOS.
I am currently writing custom renderer for navigation drawer(MasterDetailPage).
I am currently writing custom renderer for Android and i have tried many things.
Currently my MasterDetail Page renders according to OS's default behaviour i.e. in Android master page starts below the app bar but i wanted my master page to popover app bar or start above the app bar like gmail,stack exchange android app etc
use this theme Theme.AppCompat.Light.NoActionBar for the expected behaviour
There exists one already, as of this writing it is out of date though (not targeting Xamarin Forms 2): https://github.com/nativecode-dev/oss-xamarin. Perhaps you can use that?

Issue while setting WindowSoftInputMode to AdjustPan

I’m working on Xamarin forms project. I’ve many Entry fields in my application, one of them is in popup and the popup opens in the centre of the device screen. Also few entry fields are in scroll view. The issue is only with the Android Application. For iOS it’s working perfectly.
When I click on Entry field in side the popup, the soft key board is opened and the UI of my popup gets disturbed. So, I decided to set
WindowSoftInputMode = SoftInput.AdjustPan to my main Activity. This solves my UI issue of the popups but now when I click on other entry fields,my ![scroll view stops scrolling] (few entry fields are in side scrollview).I tried by using AdjustResize and rest of other soft inputs, but of no use.
Any ideas on how to get rid of this ?
On Android Xamarin.Forms Application is working on a single Android Activity, so WindowSoftInputMode is set globally. You could do a dependency injection service. On iOS it would do nothing and on Android it would set WindowSoftInputMode to your desired value. Then use it to set WindowSoftInputMode before and after showing your Popup.
In Xamarin.Forms Forms.Context is the Activity.
var window = ((Activity)Forms.Context).Window;
window.SetSoftInputMode(SoftInput.AdjustPan);
In case of
Xamarin Android
you can access window directly from mainActivity Like so:
Window.SetSoftInputMode(Android.Views.SoftInput.AdjustPan);
or in AndroidManifest.xml
<activity android:name=".myActivity"
android:label="#string/app_name"
android:screenOrientation="sensorPortrait"
android:windowSoftInputMode="adjustPan"/>

Is possible to do sliding drawer in xamarin cross platform?

I am working in xamarin pcl project , I am trying to keep sliding drawer in my pcl project but i dont know how to do that .
Are you using Xamarin.Forms?
If not, i would advice to use a framework like MvvmCross (https://github.com/MvvmCross/MvvmCross)
This would enable you to split the actual implementation of the drawer / hamburger menu into the different UI projects like iOS and Android(maybe WP8 too).
Since those platforms all behave differently, for example Android uses Fragments which are replaced inside the activity containing your navigation drawer, you should use a custom presenter to determine where you want the specific platform to navigate to. You can find more information on that topic here: http://slodge.blogspot.co.uk/2013/06/presenter-roundup.html

Resources