nstexttab

NSTextAlignmentCenter and NSTextAlignmentRight are the wrong way round in NSTextTab?

白昼怎懂夜的黑 提交于 2019-12-11 03:38:09
问题 Can anyone please check something for me... Just to make sure I'm not going mad! I created an NSMutableParagraphStyle with tabStops , but they weren't appearing where I was expecting: float width = self.myLabel.frame.size.width; self.tabStyle.tabStops = @[[[NSTextTab alloc] initWithTextAlignment:NSTextAlignmentRight location:width - 50 options:nil], [[NSTextTab alloc] initWithTextAlignment:NSTextAlignmentRight location:width options:nil]]; Then I created a convenience method to create an