CATextView(多行輸入框)

2018-08-29 16:13 更新

類說明

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


CATextView 屬性 (點(diǎn)擊屬性名可查看屬性介紹)

屬性說明
TextFontSizeTextView的字體大小
TextTextView的文本內(nèi)容
TextColorTextView的文字顏色
DelegateTextView綁定Delegate
TextViewAlignTextView的文本對齊方式
ReturnTypeTextView的確認(rèn)鍵類型


CATextView 方法 (點(diǎn)擊方法名可查看方法介紹)

方法說明
setBackGroundImage背景圖像
resignFirstResponder隱藏鍵盤第一響應(yīng)者狀態(tài)
becomeFirstResponder彈出鍵盤第一響應(yīng)者狀態(tài)
createWithFrame創(chuàng)建一個(gè)CATextView,并指定其Frame
createWithCenter創(chuàng)建一個(gè)CATextView,并指定其Center


CATextView 屬性介紹            

TextFontSize

類型:int

解釋:設(shè)置TextView的字體大小。set/get{}。


Text

類型:std::string

解釋:設(shè)置TextView的文本內(nèi)容。set/get{}。


TextColor

類型:CAColor4B

解釋:設(shè)置TextView的文字顏色。set/get{}。


Delegate

類型:CATextViewDelegate*

解釋:TextView綁定Delegate。set/get{}。


TextViewAlign

類型:TextViewAlign

解釋:TextView的文本對齊方式。set/get{}。


ReturnType

類型:ReturnType

解釋:TextView的確認(rèn)鍵類型。set/get{}。


CATextView 方法介紹    

void setBackGroundImage(CAImage* image);

返回值:void

參數(shù):

類型參數(shù)名說明
CAImage* image圖像

解釋:設(shè)置輸入框背景圖片



virtual bool resignFirstResponder();

返回值:bool

參數(shù):

解釋:隱藏鍵盤第一響應(yīng)者狀態(tài)


virtual bool becomeFirstResponder();

返回值:bool

參數(shù):

解釋:彈出鍵盤第一響應(yīng)者狀態(tài)


static CATextView* createWithFrame(const DRect& rect);

返回值:CATextView*

參數(shù):

類型參數(shù)名說明
const DRect&rect區(qū)域大小

解釋:創(chuàng)建,并指定其Frame


static CATextView* createWithCenter(const DRect& rect);

返回值:CATextView*

參數(shù):

類型參數(shù)名說明
const DRect&rect中心點(diǎn)的位置及大小

解釋:創(chuàng)建,并指定其Center

以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號