AIR의 spark.components.WindowedApplication
은 수동으로 윈도우 경계를 늘이거나 최대화/복원 할 때 내용의 크기를 자동으로 조정합니다. 그러나 spark.components.Window
클래스는 'out of the box'와 같은 기능을 제공하지 않습니다. 해당 spark.components.Window.nativeWindow
인스턴스가 경계를 크기 조정할 때 창을 늘이거나/최대화/복원 할 때 창의 내용이 크기를 변경하지 않습니다. 내 AIR 응용 프로그램은 여러 개의 창을 열고 크기를 조절할 수 있어야합니다. nativeWindow 경계와 일치하도록 내용의 크기를 자동으로 조정할 수 있습니까?새 AIR 윈도우의 내용 자동 크기 조정
0
A
답변
1
spark.components.Window
을 의미한다고 가정하면이 값은 skinnablecontainer를 기반으로하므로 백분율 기준 레이아웃/제약 조건을 사용하지 못하게하는 어떤 것도 있어서는 안됩니다.
<s:Window xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
width="100%" height="100%">
무언가를 수동으로 처리하는 다른 방법으로는 스테이지에서 오는 ResizeEvent 수신을들 수 있습니다.
0
해결 방법은 NativeWindow에서 오는 RESIZE 이벤트를 수신 한 다음 Window의 stage
인스턴스에 수동으로 stageWidth
및 stageHeight
을 설정하는 것입니다. 아래 코드를 참조하십시오.
override public function open(openWindowActive:Boolean=true):void {
super.open(openWindowActive);
if (nativeWindow) {
chromeWidth = nativeWindow.width - this.width;
chromeHeight = nativeWindow.height - this.height;
nativeWindow.addEventListener(NativeWindowBoundsEvent.RESIZE, onNativeResize);
}
}
private function onNativeResize(event:NativeWindowBoundsEvent):void {
stage.stageWidth = event.afterBounds.width - chromeWidth;
stage.stageHeight = event.afterBounds.height - chromeHeight;
}
관련 문제
- 1. QDockWidget의 내용 자동 크기 조정
- 2. 윈도우의 축소판 축소 크기 조정
- 3. 자동 크기 조정 JTextArea
- 4. 안드로이드 - 윈도우의 여러 EditText 필드는 크기 조정
- 5. 자동 크기 조정 배경과 자동 크기 조정 이미지를 겹치는 방법
- 6. iPhone에서보기의 크기 조절 자동 크기 조정
- 7. JLayeredPane의 자동 컨텐츠 크기 조정
- 8. 자동 크기 조정 CCLabelBMFont
- 9. iPhone에서보기 자동 크기 조정
- 10. 자동 크기 조정 GtkScrolledWindow
- 11. Iframe 자동 크기 조정
- 12. 자동 크기 조정 iFrame
- 13. 자동 크기 조정 방법
- 14. uiview의 자동 크기 조정
- 15. 정지 자동 크기 조정
- 16. 자동 크기 조정 UILabel
- 17. 자동 크기 조정 AWS
- 18. TabNavigator flex3의 내용 크기 조정
- 19. uinavigation 컨트롤러의 내용 크기 조정
- 20. 내용 기반의 UIView 크기 조정
- 21. Fancybox 높이 크기 조정 동적 내용
- 22. 양식의 애니메이션 자동 크기 조정
- 23. 자동 크기 조정 내용 - 한 페이지 웹 사이트
- 24. WPF : GridSplitter를 사용하여 내용 크기 조정
- 25. NSView의 자동 크기 조정 동작
- 26. Adobe Air SDK 페이지로드시 창의 크기 조정
- 27. 제품에 대한 자동 크기 조정. 회전 장치
- 28. Python의 tkinter에서 자동 크기 조정
- 29. OpenLayers FramedCloud 자동 크기 조정
- 30. 자동 크기 조정 JavaScript 슬라이더
불행히도 % basebased width와 height는 예상대로'spark.components.Window'에서 작동하지 않습니다. 아무 일도 일어나지 않습니다. Event.RESIZE에 대한 EventListener를'stage'에 추가하면 ** up ** - 창 크기를 조정할 때 잘 작동합니다. ** ** 크기를 낮추려고 할 때 ** 창 크기가 바뀌지 만 크기가 조정되지 않습니다. 리스너에 대한 내 코드는 다음과 같습니다. private function onStageResize (event : Event) : void {width = stage.width; height = stage.height; }' – Hunternif
감사합니다, 마이크, 이제 크기 조정 이벤트를 청취하는 올바른 방법을 알아 냈습니다. – Hunternif