I have a UIButton which is really just 2 words, wrapped to 2 lines (I set the lines value to "2" in code later). I have been tightening up the default lineSpacing by putting in a negative value for the paragraph lineSpacing (as simplified & shown below).
As of iOS 10.3, it appears the negative value is now being ignored. While I can increase the lineSpacing with a positive value, I can not tighten up the 2 lines anymore.
Does anyone else know how to tighten this up in a UIButton? (I'm about ready to change that control up... but thought I'd post the question).
Much thanks all.
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
paragraphStyle.lineSpacing = -15.0f;
paragraphStyle.alignment = NSTextAlignmentLeft;
NSDictionary * attributes = [NSDictionary dictionaryWithObjectsAndKeys:
[UIColor whiteColor], NSStrokeColorAttributeName,
[UIColor greenColor], NSForegroundColorAttributeName,
@(-2.0), NSStrokeWidthAttributeName,
paragraphStyle, NSParagraphStyleAttributeName,
nil];
NSMutableAttributedString *buttonTitle = [[NSMutableAttributedString alloc] initWithString:str attributes:attributes];
self.theButton.titleLabel.numberOfLines = 2;
[self.theButton setAttributedTitle:buttonTitle forState:UIControlStateNormal];
edit: Looks like this is also an issue with UILabel also.