#06 能輸入單行文字的 UITextField

Photo by Cedrik Wesche on Unsplash

Placeholder:淺色的提示輸入內容字樣。

Border Style:邊框樣式。有 None、Line、Bezel、Round 四種選擇。

Clear Button:清除按鈕出現時機。另有 Clear when editing begins 功能可勾選。

Never appears
Appears while editing
Appears unless editing
Is always visible
Clear when editing begins

Min Font Size & Adjust to Fit:文字若超出輸入欄就縮至設定的文字大小。

Min Font Size & Adjust to Fit

Text Input Traits

Text Input Traits

Content Type:可定義輸入的資料類型。

Content Type

Capitalization:字首大寫設定。

  1. None: 不做任何調整。
  2. Words: 每個以空白隔開的字串字首都變成大寫。
  3. Sentences: 僅輸入內容的第一個字母變成大寫。
  4. All Characters: 每個字母都變成大寫。

Keyboard Type:彈出鍵盤類型設定。

Keyboard Type

Keyboard Look:鍵盤樣式設定,有 Default / Dark / Light。

Return Key:改變返回鍵的字樣。

Auto-enable Return Key:勾選後,必須輸入內容才能按下 Return Key。

Secure Text Entry:勾選後,可把輸入內容用黑點遮掉,防止被看到。

補充:跳出小鍵盤快捷鍵:cmd + K

--

--