2012-03-02 7 views

答えて

0

、IF文を置きます。

#define DEGREES_TO_RADIANS(angle) (angle/180.0 * M_PI) 

if (interfaceOrientation == UIInterfaceOrientationPortrait) { 

    //Rotate view here by 180 degrees 
    CGAffineTransform rotation = CGAffineTransformIdentity; 
    rotation = CGAffineTransformRotate(rotationTransform, DEGREES_TO_RADIANS(180)); 

    view.transform = rotation; 

} 

ユーザーが期待するものと反対の方向に回転すると、アプリが拒否されているになりますのでご注意ください。

+0

ところで、通常は 'willAutorotateToInterfaceOrientation:'のように 'shouldAutorotateToInterfaceOrientation:'のように変更するべきではありません。ローテーションが起こることが許されているかどうかを単に判断するだけですべきです。 –

+0

おっと、それは私が言いたいことです。それを指摘してくれてありがとう! –

関連する問題