我有一個NSTextField我添加NSMutableAttributedString。我想將該字符串的大小設置爲大數字,但是當我這樣做時,文本會被截斷。如何讓NSTextField變得更大?如何使NSTextField適合NSMutableAttributedString包含
這是我有:
NSTextField* textField = [[NSTextField alloc] init];
NSMutableAttributedString* text = [[NSMutableAttributedString alloc]
initWithString:@"0"];
NSRange titleRange = NSMakeRange(0, [text length]);
[text addAttribute:NSFontAttributeName
value:[NSFont boldSystemFontOfSize:25]
range:titleRange];
[textField setAttributedStringValue:text];
有什麼建議? 在此先感謝
有U使用自動佈局? – TechBee
我正在使用自動佈局,是 – RuLoViC