Unable to switch to iOS numeric keypad

My application will not allow users to switch keyboard to keyboard with number / symbol. gif showing no keyboard response

I have nothing in my user interface inspector that appears at the bottom of the screen.

User interface inspector

I am really puzzled by what might cause this problem. Regardless of the fact that it locks the number / character switch, the keyboard language selector (or Emoji) and the speech button for text. Space and return key on the same line continue to work fine.

Corrupted by UITextField subclasses, the keyboard works as expected on the other 5 views in which they are contained, but here is their code:

JCTextField.h

#import <UIKit/UIKit.h> IB_DESIGNABLE @interface JCTextField : UITextField @property (nonatomic, retain) IBInspectable UIColor *underlineColor; @property (nonatomic) IBInspectable CGFloat underlineWidth; @property (nonatomic, retain) IBInspectable UIImage *sideImage; @property (nonatomic) IBInspectable CGFloat internalOffset; @property (nonatomic) IBInspectable CGFloat borderOffset; @end 

JCTextField.m

 #import "JCTextField.h" @implementation JCTextField - (id)initWithCoder:(NSCoder *)aDecoder { self = [super initWithCoder:aDecoder]; if(self != nil) { self.underlineColor = [UIColor blackColor]; self.underlineWidth = 1; self.internalOffset = 0; self.borderOffset = 0; } return self; } - (void)layoutSubviews { [super layoutSubviews]; CALayer *border = [CALayer layer]; border.borderColor = _underlineColor.CGColor; border.frame = CGRectMake(_borderOffset, self.frame.size.height - _underlineWidth, self.frame.size.width - (_borderOffset * 2), self.frame.size.height); border.borderWidth = _underlineWidth; [self.layer addSublayer:border]; self.layer.masksToBounds = YES; [self setValue:[UIColor lightTextColor] forKeyPath:@"_placeholderLabel.textColor"]; [self setTextColor:[UIColor whiteColor]]; [self setFont:[UIFont fontWithName:@"Montserrat-Regular" size:16.0]]; if (self.sideImage) { UIImageView *sideImageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.frame.size.width - 30, 0, 30, 30)]; sideImageView.contentMode = UIViewContentModeCenter; sideImageView.image = self.sideImage; [self addSubview:sideImageView]; } [self setTintColor:[UIColor whiteColor]]; [self setValue:[UIColor lightGrayColor] forKeyPath:@"_placeholderLabel.textColor"]; } - (CGRect)textRectForBounds:(CGRect)bounds { if (self.sideImage) { UIEdgeInsets insets = UIEdgeInsetsMake(0, _internalOffset, 0, 18); return [super textRectForBounds:UIEdgeInsetsInsetRect(bounds, insets)]; } UIEdgeInsets insets = UIEdgeInsetsMake(0, _internalOffset, 0, 0); return [super textRectForBounds:UIEdgeInsetsInsetRect(bounds, insets)]; } - (CGRect)editingRectForBounds:(CGRect)bounds { if (self.sideImage) { UIEdgeInsets insets = UIEdgeInsetsMake(0, _internalOffset, 0, 18); return [super textRectForBounds:UIEdgeInsetsInsetRect(bounds, insets)]; } UIEdgeInsets insets = UIEdgeInsetsMake(0, _internalOffset, 0, 0); return [super textRectForBounds:UIEdgeInsetsInsetRect(bounds, insets)]; } @end 
+5
source share

Source: https://habr.com/ru/post/1257980/


All Articles