最佳答案
第一种方法:将字体大小更改为可以容纳在段中的较小尺寸
UIFont *font = [UIFont boldSystemFontOfSize:12.0f];
NSDictionary *attributes = [NSDictionary dictionaryWithObject:font
forKey:NSFontAttributeName];
[segmentedControl setTitleTextAttributes:attributes
forState:UIControlStateNormal];
第二种方式:根据文本设置段的宽度。 (感谢the_UB的评论)
请引用How can I calculate correct widths for UISegmentedControl segments?
第三种方法:尝试使用可滚动控件,例如分段
请引用:https://www.cocoacontrols.com/controls/carbonkit和 https://www.cocoacontrols.com/controls/pagingmenucontroller
关于ios - iOS中如何完成Segmented Control的文本显示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34743861/