11
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

UITextFieldのカーソルの色を変える方法 (swift)

Last updated at Posted at 2015-08-14

すごく細かいですが、UITextFieldのカーソルの色を変えたいとき。

iOS_Simulator_-iPhone_6-iPhone_6___iOS_8_1__12B411.png

これです。テキストの入力位置を指すライン。
ちなみに、これはカーソルではなく**キャレット(caret)**と呼ぶそうです。

デフォルトでは青色なので、背景色によっては気持ちわるいと思うことがあります。

色を変えるコードは以下


mTextField.tintColor = UIColor.whiteColor()

こうなります。

スクリーンショット_2015_08_14_19_43.png

おわり

11
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?