Categories: CrossApp 教程

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
int height 高度

解释:键盘高度

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

返回值:bool

参数:

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

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

terry

这个人很懒,什么都没有留下~

Share
Published by
terry

Recent Posts