Xamarin Forms Material Android Entry Numeric Only - xamarin

I am using Xamarin Forms Visual Material and I cannot find a way to only show a numeric keyboard. I have tried setting the Keyboard property to Numeric as well as setting the EditText InputType in the renderer but the default keyboard always displays. Any thoughts or help?

Related

Xamarin - support inserting GIF and images using Android keyboard

Has anyone gotten the android keyboard to support GIF and image insertion in an Xamarin app? Let's say I want to build a chat application, have a custom EditText view to capture user input, and want to have it behave similar to the Android built-in chat application. Currently the keyboard shows a popup . Is it possible to make this work? I prefer to not create a custom keyboard renderer, though was hoping this could be done within a custom EditText renderer. Along the lines of:
UPDATE: For anyone looking for a similar solution, I have been making progress using the https://github.com/xamarin/monodroid-samples/tree/main/android-n/CommitContentSample. Essentially set the content mime types and wrap the IOnCommitContentListener, then process OnCommitContent().

Change iOS status bar text color while dark mode is activated

With iOS 13 new dark mode feature, it now seems impossible for me to control the status bar text color in Xamarin Forms. Most of the solutions I find seem to be from before dark mode was introduced to iOS.
My application uses resources so that I can easily change the style of the whole app. Even in dark mode, the color of my navigation bar is not pleasant to read with white text. I need to set the color of the status bar to black, no matter what color mode the device has activated.
I've tried to set the colors manually in my navigation page, but it seems to be overriden by iOS color mode. This code works on Android:
BarTextColor = Color.Black;
BarBackgroundColor = (Color)App.Instance.Resources["PrimaryColor"];
I've tried setting true and false to UIViewControllerBasedStatusBarAppearance.
I've also tried all settings of Status Bar Style in Info.plist.
Does anyone know of a way to control this in Xamarin Forms since the release of Dark Mode?
Did you check this docs? NavigationPage Bar Translucency on iOS NavigationPage Bar Text Color Mode on iOS . Maybe translucency can solve your problem?
The problem was fixed by switching to Xamarin iOS SDK 13, it adds an item to the StatusBarStyle enumeration.
More info here.

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

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...

Select text and copy from label xamarin forms

I have for some days been reading on different forums about the issue of selecting a text and copying the text natively from a label in xamarin forms and it seems to be no straightforward way of implementing this.
My problem is that I need to present a large amount of data from a book in a label and the user should be able to select and copy a chunk of text from the label.
I moved on to present the data in an Editor component instead but then the user can edit the text in the Editor. Making the Editor component read-only doesn't solve the problem either.
Any suggestions would be greatly appreciated!
I recently faced the same business requirement. An Editor with Renderers customization on each platform was the solution for me.
In short, Android renderer leverages CustomSelectionActionModeCallback and CustomInsertionActionModeCallback properties of EditText to customize context menu for text selection and insertion, while iOS renderer is pretty straight-forward and sets Selectable and Editable properties of UITextView.
Check out my post with full code for Xamarin.Forms. You can also read posts on native Android and native iOS for more details.
I have the same requirement and I implemented CustomLabelRenderer for Android and iOS platform.

Hide keyboard when button is clicked in xamarin forms

I am new to xamarin forms, I have a requirements that should hide the mobile keyboard when user click search button.
I am not sure yet how to do it in xamarin forms
There are a couple of ways to do this, the most common are as follows:
View.ResignFirstResponder();
OR
View.EndEditing(true);

Resources