This is a migrated thread and some comments may be shown as answers.

Numeric Keyboard iOS

5 Answers 694 Views
Entry
This is a migrated thread and some comments may be shown as answers.
Pedro
Top achievements
Rank 1
Pedro asked on 01 Aug 2018, 09:52 AM

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.

5 Answers, 1 is accepted

Sort by
0
Didi
Telerik team
answered on 02 Aug 2018, 12:38 PM
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
0
Pedro
Top achievements
Rank 1
answered on 07 Aug 2018, 06:28 AM

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


0
Didi
Telerik team
answered on 07 Aug 2018, 11:11 AM
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
0
Pedro
Top achievements
Rank 1
answered on 07 Aug 2018, 12:21 PM

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

0
Didi
Telerik team
answered on 08 Aug 2018, 08:29 AM
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
Tags
Entry
Asked by
Pedro
Top achievements
Rank 1
Answers by
Didi
Telerik team
Pedro
Top achievements
Rank 1
Share this question
or