Drop Shadow on UITextField text

前端 未结 4 548
再見小時候
再見小時候 2020-11-30 17:56

Is it possible to add a shadow to the text in a UITextField?

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-30 18:38

    As of 3.2, you can use the CALayer shadow properties.

    _textField.layer.shadowOpacity = 1.0;   
    _textField.layer.shadowRadius = 0.0;
    _textField.layer.shadowColor = [UIColor blackColor].CGColor;
    _textField.layer.shadowOffset = CGSizeMake(0.0, -1.0);
    

提交回复
热议问题