CATextViewDelegate

类说明

textView事件代理

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

方法说明
textViewShouldBeginEditing开始编辑时触发
textViewShouldEndEditing结束编辑时触发
textViewShouldReturn返回时触发
keyBoardHeight键盘高度
textViewShouldChangeCharacters文字更改后触发

CATextViewDelegate 方法说明

virtual bool textViewShouldBeginEditing(CATextView * sender)

返回值:bool

参数:

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

解释:开始编辑时触发

virtual bool textViewShouldEndEditing(CATextView * sender)

返回值:bool

参数:

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

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

virtual void textViewShouldReturn(CATextView *sender){}

返回值:void

参数:

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

解释:返回时触发

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

返回值:void

参数:

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

解释:键盘高度

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

返回值:bool

参数:

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

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

作者:terry,如若转载,请注明出处:https://www.web176.com/crossapp/10212.html

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

相关推荐

发表回复

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