Forum Xamarin.Android

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Keyboard doesn't show decimal point in landscape mode

RubaRuba Member ✭✭
edited August 2018 in Xamarin.Android

I just inherit the entry control and use Custom rendering on android platform with KeyListener. After that type 12.23 it shows correct value in portrait mode with Keyboard in OnFocus mode. When I change the orientation from portrait to landscape with Keyboard in OnFocus mode the value changed from 12.23 to 1223. Please give the solution for this.

RenderFile Coding in android Platform

public class CustomRendering: EntryRenderer
{
public CustomRendering(Context context) : base(context)
{

    }

    protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
    {
        base.OnElementChanged(e);
        if (Control != null)
        {
            Control.KeyListener = Android.Text.Method.DigitsKeyListener.GetInstance("-" + "0123456789" + ".");
        }
    }
}

Answers

This discussion has been closed.