2011-12-26 80 views

回答

1

您將需要使用CGAffineTransform。 作爲使用這將旋轉你的標籤,所以你可以做類似下面

在.h文件中

UILabel *myLabel; 

在.m文件 如果你想在開始然後在下面寫來顯示文本傾斜代碼viewDidLoad函數

[email protected]"Hello world"; 
CGAffineTransform transformRotate = CGAffineTransformMakeRotation((M_PI * -90/180.0)); 
//above you can change the angle so that you can get the required rotation 
myLabel.transform = transformRotate; 
+0

但是,我在哪裏添加文本或字符串「示例」。我需要「示例」旋轉,我如何編輯上面的代碼來做到這一點? – sharon 2011-12-26 08:24:04

+0

我已經更新了我的上面的答案.. – 2011-12-26 09:28:15

+0

它的工作在我的情況下是完美的。感謝分享 – Gaurav 2012-07-23 11:21:46