Numeric Keyboard iOS

6 posts, 0 answers
  1. Pedro
    Pedro avatar
    4 posts
    Member since:
    Jul 2018

    Posted 01 Aug 2018 Link to this post

    Hello,

    When I set the keyboard to numeric on iOS it is showing the regular keyboard with the numbers on top and on Xamarin.Forms regular entry it shows the numeric keyboard.

    This is happening only on iOS, on Android it works normal.

    Am I doing something wrong or this is the expected behavior?

    Thanks

    PS: I attached two screenshots with the keyboards displaying.

  2. Didi
    Admin
    Didi avatar
    230 posts

    Posted 02 Aug 2018 Link to this post

    Hi Pedro,

    Thank you for the provided images.

    When the Keyboard of the RadEntry control is set to Numeric by design it looks like as the attached image. In order to use a numeric keyboard similar to the Xamarin.Forms Entry control I suggest using the Telephone keyboard. Another option could be creating an effect for the iOS project. Please take a look at the attached project in order to familiarize with how the effect is implemented.

    Let me know if you have any other questions on this.

    Regards,
    Didi
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Pedro
    Pedro avatar
    4 posts
    Member since:
    Jul 2018

    Posted 07 Aug 2018 Link to this post

    Hi Didi,

    The provided solution worked just on some cases, I don't know why.

    Anyway, I solved it by creating a custom renderer for RadEntry where I change the keyboard if it is numeric.

    Here is the code, in case someone also wants the same behavior.

    using Telerik.XamarinForms.Input;
    using TestRevamp.iOS.Renderers;
    using UIKit;
    using Xamarin.Forms;
    using Xamarin.Forms.Platform.iOS;
     
    [assembly: ExportRenderer(typeof(RadEntry), typeof(RadEntryRenderer))]
    namespace Test.iOS.Renderers
    {
        public class RadEntryRenderer : Telerik.XamarinForms.InputRenderer.iOS.EntryRenderer
        {
            protected override void OnElementChanged(ElementChangedEventArgs<RadEntry> e)
            {
                base.OnElementChanged(e);
     
                if (Element == null)
                    return;
     
                if (Element.Keyboard == Keyboard.Numeric)
                {
                    Control.KeyboardType = UIKeyboardType.NumberPad;
                }
            }
        }
    }

     

    Thank you


  4. Didi
    Admin
    Didi avatar
    230 posts

    Posted 07 Aug 2018 Link to this post

    Hi Pedro,

    Thank you for sharing your solution. I am glad to hear that you found a way to resolve the issue.

    Could you please elaborate more on which cases the provided from our side solution didn't work property? In this way I could research it further.

    Looking forward to your reply.

    Regards,
    Didi
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  5. Pedro
    Pedro avatar
    4 posts
    Member since:
    Jul 2018

    Posted 07 Aug 2018 Link to this post

    Hi Didi

    Yes, I will explain what happened.

    First view:

        1 RadEntry: e-mail keyboard, it's working fine

    Second view:

        2 RadEntry, first read-only and the second with the effect attached, working fine.

    Third view:

        1 RadEntry with effect, not working fine, still showing the default Number keyboard

    On third view it didn't hit the breakpoint, I didn't understand why

    I am using these entries in a control that I created and exposed the properties and bindable properties.

    Unfortunately I can't share my code, since it belongs to my company, but I will try to reproduce it this weekend when I get home and then I'll share.

    Thanks

  6. Didi
    Admin
    Didi avatar
    230 posts

    Posted 08 Aug 2018 Link to this post

    Hi Pedro,

    Yes, I understand you couldn't share your implementation.

    Please take you time and if you manage to reproduce it in an isolated app, send it to us and we'll investigate it.

    Regards,
    Didi
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top