Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

设置inputType为CRInputType_Normal输入英文有问题 #43

Open
Azraeltulips opened this issue Dec 3, 2020 · 3 comments
Open

设置inputType为CRInputType_Normal输入英文有问题 #43

Azraeltulips opened this issue Dec 3, 2020 · 3 comments

Comments

@Azraeltulips
Copy link

Azraeltulips commented Dec 3, 2020

设置inputType为CRInputType_Normal输入英文字母,在输入到第二英文时,左上角会出现一个浅蓝色的view

@Azraeltulips
Copy link
Author

Azraeltulips commented Dec 3, 2020

`#pragma mark - CustomBox

  • (CRBoxInputView *)generateBoxInputView_customBox
    {
    CRBoxInputCellProperty *cellProperty = [CRBoxInputCellProperty new];
    cellProperty.cellBgColorNormal = color_FFECEC;
    cellProperty.cellBgColorSelected = [UIColor whiteColor];
    cellProperty.cellCursorColor = color_master;
    cellProperty.cellCursorWidth = 2;
    cellProperty.cellCursorHeight = YY_6(27);
    cellProperty.cornerRadius = 4;
    cellProperty.borderWidth = 0;
    cellProperty.cellFont = [UIFont boldSystemFontOfSize:24];
    cellProperty.cellTextColor = color_master;
    cellProperty.configCellShadowBlock = ^(CALayer * _Nonnull layer) {
    layer.shadowColor = [color_master colorWithAlphaComponent:0.2].CGColor;
    layer.shadowOpacity = 1;
    layer.shadowOffset = CGSizeMake(0, 2);
    layer.shadowRadius = 4;
    };

    CRBoxInputView *_boxInputView = [[CRBoxInputView alloc] initWithCodeLength:4];
    _boxInputView.mainCollectionView.contentInset = UIEdgeInsetsMake(0, 10, 0, 10);
    _boxInputView.boxFlowLayout.itemSize = CGSizeMake(XX_6(52), XX_6(52));
    _boxInputView.customCellProperty = cellProperty;
    _boxInputView.keyBoardType = UIKeyboardTypeDefault;
    _boxInputView.inputType = CRInputType_Normal;

    [_boxInputView loadAndPrepareViewWithBeginEdit:YES];

    return _boxInputView;
    }`
    这个是我在demo里面修改了键盘类型和输入类型,也会出现同样的问题,输入h比较容易复现

@CoderGFWu
Copy link

我也碰到了, 兄弟, 有解决吗

@Azraeltulips
Copy link
Author

我也碰到了, 兄弟, 有解决吗

textField有个自动联想的属性autocorrectionType设置为no。然后要过滤一下中文,因为iPhone有一个自带的快捷文本,英文键盘输入msd,会有一个马上到的弹窗。
`// MARK: ===============检查文字是否是中文===============
private func checkStringIsChinese(_ string: String) -> Bool {
for character in string {
if character >= "\u{4E00}" && character <= "\u{9FA5}" {
return true
}
}

    return false
}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants