简体   繁体   English

如何防止AIR应用程序在拖动时突然晃动?

[英]How to prevent AIR application from jerking around while dragging?

I've created an AIR application and it seems to be working fine but when I drag the title bar to move the native window it shakes violently and have seizures while it's dragging about. 我已经创建了一个AIR应用程序,它似乎运行良好,但是当我拖动标题栏以移动本机窗口时,它猛烈地摇动并在拖动时出现癫痫发作。

FYI It does eventually end up where I want it to be when I stop moving the mouse. 仅供参考,当我停止移动鼠标时,它最终会到达我希望的位置。

I'm using Flex 4.6 and AIR 3.6 on Mac OSX 10.10.5. 我在Mac OSX 10.10.5上使用Flex 4.6和AIR 3.6。 It's a s:WindowedApplication I'm also using the DragManager on a list in part of the application if that matters but it is not enabled until the user clicks into the list and moves more than a certain number of pixels. 这是一个s:WindowedApplication如果这很重要,我也会在应用程序的一部分列表上使用DragManager,但是只有在用户单击列表并移动超过一定数量的像素后,它才会启用。

Here is my descriptor file minus name and version info: 这是我的描述符文件减去名称和版本信息:

<application xmlns="http://ns.adobe.com/air/application/3.6">
    <initialWindow>
        <autoOrients>false</autoOrients>
        <fullScreen>false</fullScreen>
        <visible>false</visible>
    </initialWindow>
</application>

On initialize I run this: 在初始化时,我运行以下命令:

protected function initializeHandler(event:FlexEvent):void {

    width = Capabilities.screenResolutionX * .96;
    height = Capabilities.screenResolutionY * .9;

    nativeWindow.x = (Screen.mainScreen.bounds.width - width)/2;
    nativeWindow.y = (Screen.mainScreen.bounds.height - height)/2;

}

UPDATE: 更新:
I removed the main view component so it is an empty application and it drags around smoothly. 我删除了主视图组件,因此它是一个空应用程序,并且拖动起来很顺畅。

UPDATE 2: 更新2:
I added the main view back in and dragged around step by step along the way. 我重新添加了主视图,并逐步拖动它。 It appears to start happening when I've loaded a second Application (called a sub application) into the main application. 当我将第二个应用程序(称为子应用程序)加载到主应用程序中时,它似乎开始发生。 I'm not sure though. 我不确定。

This happens in numerous number of my applications. 这在我的许多应用程序中都会发生。 It is probably because I have a component inside my application file set to size to 100% of the application. 可能是因为我的应用程序文件中有一个组件,其大小设置为应用程序的100%。 But I have not verified this on all my apps. 但是我尚未在所有应用程序上对此进行验证。

The solution is to resize the AIR app. 解决方案是调整AIR应用程序的大小。 After I resize it it works fine. 调整大小后,它可以正常工作。 I can drag it around and it works as expected. 我可以拖动它,它可以按预期工作。 I think this is an AIR bug. 我认为这是一个AIR错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM