iOS

[iOS] UITextField Placeholder 색바꾸기!

사과농사 2021. 3. 7. 01:00

 

 

 

UITextField Placeholder 색 바꿔지지 않을까 생각했는데

 

네. 왠만한건 다 됩니다.

 

코드로 하는건 Placeholder를 접근해서 NSAttributedString 접근해서 바꿔주면 될 것 같습니다.. 추후에 총총..

 

Storyboard에서 바꿔주기!

 

텍스트 필드를 눌려주고 

 

identity inspector를 누릅니다.!

여기서 User Defined Runtime Attributes에 + 하여

KeyPath -> placeholderLabel.textColor (다른 글에 _placeholoderLabel.textColor라고 되있었는데 _(언더바) 없으니까 됬습니다. 저는 20210307에 Xcode최신 버전입니다. 주의하세요~)

Type -> Color

Value -> 원하는색~ 저는 다크 그레이 했습니다.

 

좀 미비하지만 진해졌다구요 !! ㅎㅎ