CATextView(多行输入框)

类说明

CATextView是多行输入框,其主要用法和CATextField相似。


CATextView 属性 (点击属性名可查看属性介绍)

属性说明
TextFontSizeTextView的字体大小
TextTextView的文本内容
TextColorTextView的文字颜色
DelegateTextView绑定Delegate
TextViewAlignTextView的文本对齐方式
ReturnTypeTextView的确认键类型


CATextView 方法 (点击方法名可查看方法介绍)

方法说明
setBackGroundImage背景图像
resignFirstResponder隐藏键盘第一响应者状态
becomeFirstResponder弹出键盘第一响应者状态
createWithFrame创建一个CATextView,并指定其Frame
createWithCenter创建一个CATextView,并指定其Center

CATextView 属性介绍            

TextFontSize

类型:int

解释:设置TextView的字体大小。set/get{}。


Text

类型:std::string

解释:设置TextView的文本内容。set/get{}。


TextColor

类型:CAColor4B

解释:设置TextView的文字颜色。set/get{}。


Delegate

类型:CATextViewDelegate*

解释:TextView绑定Delegate。set/get{}。

TextViewAlign

类型:TextViewAlign

解释:TextView的文本对齐方式。set/get{}。


ReturnType

类型: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

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

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

相关推荐

发表回复

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