gpt4 book ai didi

iphone - 表情符号将我的键盘更改为...

转载 作者:行者123 更新时间:2023-11-29 11:19:42 24 4
gpt4 key购买 nike

我有一些问题。在我的应用程序开始时,我自动显示数字键盘(我将 becomeFirstResponder 发送到其中一个文本字段)。但是,如果用户在我的应用程序之前使用过表情符号键盘,则会显示表情符号键盘。我怎样才能避免它?我想准确显示数字键盘,而不是表情符号键盘。

最佳答案

使用键盘通知并使用一些 BOOL 变量跟踪键盘,

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWasShown:) name:UIKeyboardDidShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWasHidden:) name:UIKeyboardDidHideNotification object:nil];

使用 BOOL 变量检查键盘是否已经存在。如果它在那里,请辞职并显示您的键盘。

关于iphone - 表情符号将我的键盘更改为...,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7913827/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com