AIR 3.3/Flash CS5.5를 사용하는 iOS 및 Android 용 앱을 프로그래밍하고 있습니다. 이제 문제는, 응용 프로그램이 iOS 장치에서 크기가 조정되지 않는다는 것입니다 (iPod touch 4에서 테스트).iOS 기기에서 앱의 크기가 조정되지 않습니다.
public function Main() {
this.addEventListener(Event.ADDED , Init, false, 0, true);
}
private function Init(e:Event) {
this.removeEventListener(Event.ADDED , Init);
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.addEventListener(Event.RESIZE , Resize, false, 0, true);
}
private function Resize(e:Event) {
stage.removeEventListener(Event.RESIZE, Resize);
var stageheight = Math.min(stage.fullScreenHeight, Screen.mainScreen.visibleBounds.height);
var stagewidth = Math.min(stage.fullScreenWidth, Screen.mainScreen.visibleBounds.width);
stage.stageHeight = Math.min(stagewidth, stageheight);
stage.stageWidth = Math.max(stagewidth, stageheight);
scaleFactor = stage.stageHeight/APP_ORG_HEIGHT;
NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE;
}
그것은 안드로이드 기기에서 작동하지만 내 테스트 장치 :
여기 내 코드입니다.
다음내 XML 설정 :
<initialWindow>
<systemChrome>standard</systemChrome>
<transparent>false</transparent>
<visible>true</visible>
<fullScreen>true</fullScreen>
<aspectRatio>landscape</aspectRatio>
<renderMode>gpu</renderMode>
<autoOrients>false</autoOrients>
</initialWindow>
<android>
<manifestAdditions>
<![CDATA[<manifest android:installLocation="auto">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
</manifest>]]>
</manifestAdditions>
</android>
<iPhone>
<InfoAdditions>
<![CDATA[<key>UIDeviceFamily</key><array><string>1</string></array><key>UIPrerenderedIcon</key><true/><key>UIApplicationExitsOnSuspend</key><true/>]]>
</InfoAdditions>
<requestedDisplayResolution>high</requestedDisplayResolution>
</iPhone>
답변 해 주셔서 감사합니다. 지금 테스트 해 드리겠습니다. 그러나 정확히 무엇을 의미합니까? "스테이지 스케일 모드와 스테이지 정렬을 변경하기 전에 Event.RESIZE 이벤트 처리기를 추가 할 것입니다." – WolvDev
그것은 작동합니다! 고마워요! – WolvDev