UISegmentControl默认不选中,且取消选中颜色

1.默认都不选

self.segmentControl.selectedSegmentIndex= -1;//小于0即可

2.不设置选中颜色(即选中和不选中颜色一致),将Momentary勾选即可

UISegmentControl默认不选中,且取消选中颜色_第1张图片

3.修改字体样式和字体颜色,大小

NSDictionary* textAttr =@{NSFontAttributeName:[UIFontcustomFontWithFontName:kLanTingHeiFont withFontSize:13],NSForegroundColorAttributeName:kRGBColor(51,51,51)};//kLanTingHeiFont:兰亭黑

[self.segmentControlsetTitleTextAttributes:textAttr forState:UIControlStateNormal];

你可能感兴趣的:(UISegmentControl默认不选中,且取消选中颜色)