我有一個包含一些文本框的視圖。我設置視圖的方向是這樣使用CGAffine旋轉視圖後的翻譯
(void)deviceRotated:(id)sender
{
UIDeviceOrientation orientation = [[UIDevice currentDevice]orientation];
if (orientation == UIDeviceOrientationPortrait)
{
CGAffineTransform affine = CGAffineTransformMakeRotation (0.0);
[self.View setTransform:affine];
}
if (orientation == UIDeviceOrientationPortraitUpsideDown)
{
CGAffineTransform affine = CGAffineTransformMakeRotation (M_PI * 180/180.0f);
[self.View setTransform:affine];
}
else if (orientation == UIDeviceOrientationLandscapeLeft)
{
CGAffineTransform affine = CGAffineTransformMakeRotation (M_PI * 90/180.0f);
[self.View setTransform:affine];
}
else if (orientation == UIDeviceOrientationLandscapeRight)
{
CGAffineTransform affine = CGAffineTransformMakeRotation (M_PI * 270/180.0f);
[self.View setTransform:affine];
}
}
我的問題是我要作出這樣的觀點向上移動時,鍵盤會出現,因爲一些文本框是由鍵盤隱藏。我想我必須使用CGAffineTransformMakeTranslation,但我不知道如何使用它後,旋轉。
有人可以幫我解決這個問題嗎?
謝謝.....克萊頓 – 2015-12-28 07:27:40