在 UITextField 文本上投影

Drop Shadow on UITextField text(在 UITextField 文本上投影)

本文介绍了在 UITextField 文本上投影的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以给 UITextField 中的文本添加阴影?

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

推荐答案

从 3.2 开始,您可以使用 CALayer 阴影属性.

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);

这篇关于在 UITextField 文本上投影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:在 UITextField 文本上投影