1
我跟着回答這裏:如何更改自定義NSTextField的大小和字體?
https://stackoverflow.com/a/3233802/3850487
我能夠使用@戴夫代碼,它的偉大工程。
唯一的是我似乎無法找到一種方法來更改我的標籤的字體或大小。
[self.rssLabel setText:fullString];
[self.rssLabel setSpeed:0.03f];
[[self rssLabel] setFont:[NSFont boldSystemFontOfSize:100]];//NOT WORKING
什麼都沒有發生,就好像它沒有受到影響。
我得到的最接近是當我加入一些代碼來- (void)drawRect:(NSRect)dirtyRect
- (void)drawRect:(NSRect)dirtyRect {
// Drawing code here.
[[NSColor grayColor] set];//changed the background of the view
NSRectFill(dirtyRect); //not text color
...
}
我試圖聯繫戴夫,但我不能評論呢,請指教。