我在Xcode中處理的項目是在橫向上完成的。 我可能會做錯某些事情,但我必須將每個圖像旋轉270度,然後纔將它們添加到我的文件中。iOS中的風景旋轉文本
NSString *strFromInt = [NSString stringWithFormat:@"%d",score];
CGContextRef gc = UIGraphicsGetCurrentContext();
CGContextSetRGBFillColor(gc, 1, 1, 1, 1);
NSString *str = (@"Score ");
UIFont *uif = [UIFont systemFontOfSize:40];
[strFromInt drawAtPoint:CGPointMake(150, 10) withAttributes:@{NSFontAttributeName:uif}];
[str drawAtPoint:CGPointMake(10, 10) withAttributes:@{NSFontAttributeName:uif}];
當我嘗試在上面的代碼中添加分數時,文本沿着牆壁垂直運行。 任何方法來解決這個問題(最好在一個方法,不會讓我必須再次旋轉我的所有圖像47)?
這與Xcode IDE以及iOS的一切無關。我看到你正在繪製字符串,但如果它是某種其他類型的對象(例如UILabel),則可能有更簡單的方法來執行此操作。 –