鍵盤樣式風格設定

2021-09-22 11:16:22 字數 1270 閱讀 1787

一、鍵盤風格   

uikit框架支援8種風格鍵盤。

typedefenumuikeyboardtype;  

用法用例:

textview.keyboardtype = uikeyboardtypenumberpad;

二、鍵盤外觀

typedefenumuireturnkeytype;  

用法用例:

textview.returnkeytype=uireturnkeygo;

四、自動大寫

typedefenumuitextautocapitalizationtype;  

用法用例:

textfield.autocapitalizationtype

= uitextautocapitalizationtypewords

;五、自動更正

typedefenumuitextautocorrectiontype;  

用法用例:

textfield.autocorrectiontype= uitextautocorrectiontypeyes;

六、安全文字輸入

textview.securetextentry=yes;

開啟安全輸入主要是用於密碼或一些私人資料的輸入,此時會禁用自動更正和自此快取。

uitextfield和uitextview隱藏鍵盤

self._textfield.returnkeytype=uireturnkeydone;

self._textfield.delegate=self;

- (bool)textfieldshouldreturn:(uitextfield *)textfield

self._textview.delegate=self;

self._textview.returnkeytype=uireturnkeydone;

- (bool)textview:(uitextview *)textview shouldchangetextinrange:(nsrange)range

replacementtext:(nsstring *)text

return yes;

}

分享到:

鍵盤樣式風格設定

一 鍵盤風格 uikit框架支援8種風格鍵盤。typedefenumuikeyboardtype 用法用例 textview.keyboardtype uikeyboardtypenumberpad 二 鍵盤外觀 typedefenumuireturnkeytype 用法用例 textview.re...

鍵盤樣式風格設定及隱藏

一 鍵盤風格 uikit框架支援8種風格鍵盤。typedef enum uikeyboardtype 用法用例 textview.keyboardtype uikeyboardtypenumberpad 二 鍵盤外觀 typedef enum uireturnkeytype 用法用例 textvie...

IOS鍵盤樣式風格有關設定

一 鍵盤風格 uikit框架支援8種風格鍵盤。uikeyboardtype 用法用例 textview.keyboardtype uikeyboardtypenumberpad 二 鍵盤外觀 uireturnkeytype 用法用例 textview.returnkeytype uireturnke...