UITextField set placeholder color as dark in iOS

前端 未结 8 845
误落风尘
误落风尘 2021-02-01 10:59

I have tried to set UITextField \"Placeholder\" color as dark.

NSAttributedString * search = [[NSAttributedString alloc] initWithSt         


        
8条回答
  •  长情又很酷
    2021-02-01 11:17

    To make it future-proof and completely customizable (color, font, size, etc.), I would just add a UILabel on top and hide/show it manually according to the UITextField contents.

    Just make sure to set the label's userInteractionEnabled to NO.

提交回复
热议问题