扫码关注官方订阅号
比如我想把字体设置为空心的 比如类似这样的
在线等
光阴似箭催人老,日月如移越少年。
你确定这不是粗体,或者其他字体??
NSArray *array = [UIFont familyNames]; NSLog(@"%@",array); UITextField *textedd = [[UITextField alloc] initWithFrame:CM(15, 350, Screen_Width - 30, 40)]; textedd.font = [UIFont fontWithName:@"Party LET" size:20]; textedd.placeholder = @"dfsdfdf"; textedd.textColor = BlackColor; textedd.backgroundColor = WhiteColor; [self.view addSubview:textedd];
你设置textfiled的font属性,placeholder也会跟着变化的。
首先你这个还是 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-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
你确定这不是粗体,或者其他字体??
你设置textfiled的font属性,placeholder也会跟着变化的。
首先你这个还是 UITextField 比较适用,
然后你就设置一下背景颜色和 placeHolder就可以了
边框圆角通过layer.corderRadius修改
大致如下吧:
PS:这个方式是ios 6.0+ 才可以的,因为attributedString的原因