我正在使用 DrawRect 方法绘制一些文本,但不知道如何将这些文本向右对齐。
我知道在界面生成器中您可以指定对齐方式,所以我知道这是可能的,但我似乎无法弄清楚我自己。
在这一点上的任何帮助都非常有帮助。
非常感谢!
NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:[NSFont fontWithName:@"AvenirNext-UltraLight" size:12], NSFontAttributeName, [NSColor redColor], NSForegroundColorAttributeName, nil];
NSAttributedString * newEmail = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%d", newUnreadEmail] attributes:attributes];
[newEmail drawAtPoint:NSMakePoint(140, 600)];