テキストフィールドを含むビューがあります。このようにビューの向きを設定します
(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 を使用する必要があると思いますが、その回転後に使用する方法がわかりません。
誰かがこの問題を解決するのを手伝ってくれますか??