UISearchBar change placeholder color

前端 未结 17 2419
南旧
南旧 2020-12-04 15:16

Has anyone any idea or code sample on how can I change the text color of the placeholder text of a UISearchBar?

17条回答
  •  温柔的废话
    2020-12-04 15:55

    Swift 3

    UILabel.appearance(whenContainedInInstancesOf: [UISearchBar.self]).textColor = UIColor.white
    

提交回复
热议问题