2013-06-03 1 views
2

어떻게하면 RubyMotion 응용 프로그램이 회전하지 않게 할 수 있습니까?RubyMotion 응용 프로그램을 순환하지 않게 유지

내가 구현하는 시도 :

def shouldAutorotateToInterfaceOrientation(interfaceOrientation) 
    UIInterfaceOrientationLandscapeRight == interfaceOrientation 
end 

을하지만 응용 프로그램 전체 무언가를 원하는, 내가 응용 프로그램을 통해이를 제어 할 AppDelegate에서 설정할 수있는 방법이있다?

답변

1

당신은 여기 좋은 해결책을 찾을 수 있습니다

iOS 6 apps - how to deal with iPhone 5 screen size?

당신이 더 많은 응용 프로그램 전체 수 있도록하려는 경우, 당신이 포함 할 수있는 모듈을 만들 것을 권 해드립니다.

module Rotation 
    # methods here 
end 

class MyViewController < UIViewController 
    include Rotation 
end 
+4

감사합니다. Jamon, 나는 각 컨트롤러와 내 Rakefile'app.interface_orientations = [: portrait]'에서'def shouldAutorotate false end'를 구현했습니다. 또한 ProMotion을 사용하여 매우 기쁩니다. – Alekx

+0

쿨! :) 다행 이네. –

0

@ Alekx의 솔루션이 가장 적합했습니다. 내가해야 할 일은 ...

app.interface_orientations = [:portrait] 

... 내 Rakefile 및 voila! 더 이상 자전 할 필요가 없습니다.