iphone - 多行的 UISegmentedControl 文本?

标签 iphone xcode ios interface-builder uisegmentedcontrol

如何使我的 UISegmentedControl 中的一个按钮中的文本跨越多行?

最佳答案

使用 UIAppearance 来完成任务。下面的代码片段将起作用。在创建分割之前调用它。

objective-C

[[UILabel appearanceWhenContainedIn:[UISegmentedControl class], nil] setNumberOfLines:0];

swift

UILabel.appearanceWhenContainedInInstancesOfClasses([UISegmentedControl.self]).numberOfLines = 0

关于iphone - 多行的 UISegmentedControl 文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5614284/

相关文章:

ios - 如何在饼图上绘制虚线作为切片分隔符

ios - 如何以编程方式检查 iPhone 中可用的 3D Touch?

ios - 图书馆对图书馆的引用

ios - 如何使用persistentStore(for : url) in core data Swift 3

ios - Swift 每次内存地址跳转都会崩溃

ios - 如何彻底重命名 Xcode 中的通用框架?

iphone - 识别绘制图像的最佳方法

iphone - 如何使用 NSNotification

ios - 上传符号文件

ios - swift 类 'nil' 中的所有值