类说明
CATextView是多行输入框,其主要用法和CATextField相似。
CATextView 属性 (点击属性名可查看属性介绍)
| 属性 | 说明 |
| TextFontSize | TextView的字体大小 |
| Text | TextView的文本内容 |
| TextColor | TextView的文字颜色 |
| Delegate | TextView绑定Delegate |
| TextViewAlign | TextView的文本对齐方式 |
| ReturnType | TextView的确认键类型 |
CATextView 方法 (点击方法名可查看方法介绍)
| 方法 | 说明 |
| setBackGroundImage | 背景图像 |
| resignFirstResponder | 隐藏键盘第一响应者状态 |
| becomeFirstResponder | 弹出键盘第一响应者状态 |
| createWithFrame | 创建一个CATextView,并指定其Frame |
| createWithCenter | 创建一个CATextView,并指定其Center |
CATextView 属性介绍
类型:int
解释:设置TextView的字体大小。set/get{}。
类型:std::string
解释:设置TextView的文本内容。set/get{}。
类型:CAColor4B
解释:设置TextView的文字颜色。set/get{}。
类型:CATextViewDelegate*
解释:TextView绑定Delegate。set/get{}。
类型:TextViewAlign
解释:TextView的文本对齐方式。set/get{}。
类型:ReturnType
解释:TextView的确认键类型。set/get{}。
CATextView 方法介绍
void setBackGroundImage(CAImage* image);
返回值:void
参数:
| 类型 | 参数名 | 说明 |
| CAImage* | image | 图像 |
解释:设置输入框背景图片
virtual bool resignFirstResponder();
返回值:bool
参数:
解释:隐藏键盘第一响应者状态
virtual bool becomeFirstResponder();
返回值:bool
参数:
解释:弹出键盘第一响应者状态
static CATextView* createWithFrame(const DRect& rect);
返回值:CATextView*
参数:
| 类型 | 参数名 | 说明 |
| const DRect& | rect | 区域大小 |
解释:创建,并指定其Frame
static CATextView* createWithCenter(const DRect& rect);
返回值:CATextView*
参数:
| 类型 | 参数名 | 说明 |
| const DRect& | rect | 中心点的位置及大小 |
解释:创建,并指定其Center
(c) 2024 chaojicainiao.com MIT license