扫码关注官方订阅号
比如我想把字体设置为空心的 比如类似这样的
在线等
光阴似箭催人老,日月如移越少年。
首先你这个还是 UITextField 比较适用, 然后你就设置一下背景颜色和 placeHolder就可以了 边框圆角通过layer.corderRadius修改 大致如下吧:
_tv.layer.cornerRadius = 15.0; _tv.backgroundColor = [UIColor grayColor]; NSDictionary *attributes = @{ NSForegroundColorAttributeName : [UIColor whiteColor] }; _tv.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"搜索神马" attributes:attributes];
PS:这个方式是ios 6.0+ 才可以的,因为attributedString的原因
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
首先你这个还是 UITextField 比较适用,
然后你就设置一下背景颜色和 placeHolder就可以了
边框圆角通过layer.corderRadius修改
大致如下吧:
PS:这个方式是ios 6.0+ 才可以的,因为attributedString的原因