iphone - 更改UISegment控件的字体颜色和大小

标签 iphone uisegmentedcontrol

我想更改uisegment控件的字体颜色和字体大小。有可能吗?

如果有人这样做并且有人有解决方案,请告诉我或分享任何有用的链接

谢谢。

最佳答案

正如其他一些答案提到的,您还可以使用 setTitleTextAttributes:forState:

UIFont *font = [UIFont boldSystemFontOfSize:12.0f];
NSDictionary *attributes = [NSDictionary dictionaryWithObject:font
                                                       forKey:UITextAttributeFont];
[segmentedControl setTitleTextAttributes:attributes 
                                forState:UIControlStateNormal];

关于iphone - 更改UISegment控件的字体颜色和大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7567131/

相关文章:

ios - 如何为 UISegmentedControl 上的 tableView 重新加载设置动画点击作为 pushviewcontroller

iphone - UIGestureRecognizer 结尾

ios - 由于 Transporter,我的应用程序不会上传。我怎样才能绕过这个?

ios - Swift TableView 重新加载但单元格在单击之前保持不变

ios - 如何从分段控制中获取值(value)以了解选择了哪一个

accessibility - 你如何使 UISegmentedControl 遵循动态类型?

objective-c - 用户使用 UISegmentedControl 更改显示单位后立即更改显示单位

iphone - 操作表中的 UIPickerView 从下半部分没有响应

iphone - Objective-C 中的内存管理

iphone - iOS 开发 : How can I induce low memory warnings on device?