문제

Hi im createing a iOS application and i would like it to run on portrait all the time even when i turn it left/right i want it to stay the same here some images of all the settings relevant to portrait.

enter image description here

enter image description here

enter image description here

so thats all the stuff I've set so my question is how do i keep in in portrait even when i tilt it at the moment when it runs it opens in portrait but say if i turn it left it will rotate to landscape.

thanks in advance i will look forward to here from you.

도움이 되었습니까?

해결책

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{

    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

Use this method to support only portrait mode

다른 팁

Return YES for any orientations you support from this function.

 (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{
   return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top