CATextFieldDelegate

类说明

CATextField的数据代理

CATextFieldDelegate 方法(点击查看方法介绍)

方法说明
textFieldShouldBeginEditing开始编辑时触发
textFieldShouldEndEditing结束编辑时触发
textFieldShouldReturn返回时触发
keyBoardHeight键盘高度
textFieldShouldChangeCharacters文字更改后触发

CATextFieldDelegate 方法说明

virtual bool textFieldShouldBeginEditing(CATextField * sender)

返回值:bool

参数:

类型参数名说明
CATextField*sender当前textField

解释:开始编辑时触发

virtual bool textFieldShouldEndEditing(CATextField * sender)

返回值:bool

参数:

类型参数名说明
CATextField*sender当前textField

解释:结束编辑时触发(如果发件人不想从时间中分离,返回true)

virtual void textFieldShouldReturn(CATextField *sender){}

返回值:void

参数:

类型参数名说明
CATextField*sender当前textField

解释:返回时触发

virtual void keyBoardHeight(CATextField *sender, int height){}

返回值:void

参数:

类型参数名说明
CATextField*sender当前textField
intheight高度

解释:键盘高度

virtual bool textFieldShouldChangeCharacters(CATextField* sender, unsigned int location, unsigned int lenght, const std::string& changedText);

返回值:bool

参数:

类型参数名说明
CATextField*sender当前textField
unsigned int location光标选中的字符串,即被替换的字符串
unsigned intlenghtlength为0时,表示删除
const std::string&changedText更改文本时Text内容

解释:textField文字更改后触发(返回true表示修改生效,返回false表示不做修改,textField的内容不变)

作者:冒牌SEO,如若转载,请注明出处:https://www.web176.com/crossapp/10188.html

(0)
打赏 支付宝 支付宝 微信 微信
冒牌SEO冒牌SEO
上一篇 2023年2月21日
下一篇 2023年2月21日

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注