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"/>
Related
I have a weird problem with my Xamarin App. When I turn on the power saving mode the App resets the Detail Property of my MasterDetailPage and thus navigate back to the Loginscreen. I cant really debug that.
My Navigation works like that: I create a new NavigationPage and set the Detail Property of my MasterDetailPage to the new NavigationPage.
Does anyone know why this happens?
//Edit using FlyoutPage instead of MasterDetailPage doesn't work
//Edit2 apparently that only happens on my Zebra TC26. Also it not only resets the Detail property to its default value it resets ALL variables/properties in my entire app except static ones to its default value...
I'm currently trying to build a simple macos & WPF application with the help of the MvvMCross framework. I'm having some trouble with navigating from one Viewmodel to another. I've got my WPF client currently working as desired, but I can't seem to achieve the same behaviour for my macos client.
Clicking on any navigation button opens a separate window. What I'd like to see is that the content in the current window changes to the content of the view that was navigated towards.
You can find the code over here
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...
I'm making app with using Xamarin.forms.
I wanted to know if there is top window or view for Xamarin.forms.
I want to put something like a alert or indicator so that it remain on top depth all the time until it's gone. (even if new page is pushed.)
I can't find any view or window on XF.
Should I use each native window?
Thanks.
You can try to use Application.Current.MainPage.DisplayAlert method to display alert from the MainPage (which ordinary always exists in app).
I'm currently working on my first iOS application to run on the iPad, and I've come across a problem. I have been asked to implement menu's similar to the ones in the default applications such as when you click on the "Calendars" button in the top left of the calendars app.
Only issue is, I cant seem to find a standard UI object that looks like these, with the arrow connecting the menu to the button etc. Is this a standard UI component that I should be able to use, or will I have to imitate them by creating a custom object?
Thanks for any help.
That is a UIPopoverController. There isn't an Interface Builder control for this. You need to create one programmatically:
UIPopoverController *popover = [[UIPopoverController alloc]initWithContentViewController:someTableViewController];
See the documentation for more information and sample projects, specifically ToolbarSearch: