0
UIImageの向きをどのように設定することができますか?それは私のUIImageオリエンテーションがUIImageOrientationDownなら私はUIImageOrientationUpにそれを変更したいです。iPhone/iPadのUIImageの向きを変更する
どうすればいいですか?
私は多くを検索しましたが、これまでは画像の向きを取得する方法しか見つかっていませんでした。
UIImageの向きをどのように設定することができますか?それは私のUIImageオリエンテーションがUIImageOrientationDownなら私はUIImageOrientationUpにそれを変更したいです。iPhone/iPadのUIImageの向きを変更する
どうすればいいですか?
私は多くを検索しましたが、これまでは画像の向きを取得する方法しか見つかっていませんでした。
試み: -
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
duration:(NSTimeInterval)duration {
if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
yourImage.transform = CGAffineTransformMakeRotation(M_PI/2);
}
else if (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight){
yourImage.transform = CGAffineTransformMakeRotation(-M_PI/2);
}
else {
yourImage.transform = CGAffineTransformMakeRotation(0.0);
}
}
これはUIIMageデリゲートのですか? – Shah
@sHaH .. Nup .... UIViewController's ...オリエンテーションの変更イベントを検出します – Maulik
ああ...役に立たない兄弟。 : – Shah