Android 如何使用flash builder保持图像纵横比

Android 如何使用flash builder保持图像纵横比,android,iphone,flash,Android,Iphone,Flash,我正在使用flash builder和图像视图开发android和iPhone应用程序,但每当我在galaxy s3或iPhone上测试我的应用程序时,我都无法保持高宽比图像的高度和宽度,而在galaxy s2上工作正常 我正在使用这个代码 <?xml version="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.ad

我正在使用flash builder和图像视图开发android和iPhone应用程序,但每当我在galaxy s3或iPhone上测试我的应用程序时,我都无法保持高宽比图像的高度和宽度,而在galaxy s2上工作正常

我正在使用这个代码

<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/mx"
        xmlns:com="com.*">
    <fx:Script>
        <![CDATA[
            [Embed(source="assets/image.jpg")]
            [Bindable]
            public var desertImage:Class;  


        ]]>
    </fx:Script>
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <s:titleContent>
        <s:Label color="#FFFFFF" fontWeight="bold" fontSize="25" text="Districts"/>
    </s:titleContent>

    <s:Group id="parentContaner"  width="100%" height="100%"  >
        <com:GestureImage x="1" y="2" width="{this.width}" height="{this.height}" source="{desertImage}" smooth="true" scaleMode="letterbox"    />

    </s:Group>


</s:View>

问题已经解决了。。pinchMatrix.scalepinchEvent.scaleX=pinchEvent.scaleY,pinchEvent.scaleY;
    private function onGesturePinch(pinchEvent:TransformGestureEvent):void{
        setAsCurrentChild();  
        var pinchMatrix:Matrix = this.transform.matrix;  
        var pinchPoint:Point =  
            pinchMatrix.transformPoint(  
                new Point((this.width/2), (this.height/2)));  
        pinchMatrix.translate(-pinchPoint.x, -pinchPoint.y);  
        pinchMatrix.scale(pinchEvent.scaleX, pinchEvent.scaleY);  
        pinchMatrix.translate(pinchPoint.x, pinchPoint.y);  
        this.transform.matrix = pinchMatrix;  
    }