我一直在尝试使用 Adobe Flex / Flash 构建器 StageWebView 呈现网页,但它没有缩放网页以适应手机屏幕尺寸,并且基本上切断了网页的右侧。我试过使用
<meta name="viewPort" content="width=device-width; initial-scale=1.0;
maximum-scale=1.0; user-scalable=no;" />
这没有奏效。下面是我目前正在使用的 Flex 代码。
<?xml version="1.0" encoding="utf-8"?>
<fx:Script>
<![CDATA[
import flash.media.StageWebView;
import flash.net.URLRequest;
import spark.events.ViewNavigatorEvent;
protected var webView:StageWebView = new StageWebView();
protected var openBrowser:Boolean = false;
protected function view1_viewActivateHandler(event:ViewNavigatorEvent):void
{
if (StageWebView.isSupported)
{
currentState = "normal";
webView.stage = stage;
webView.viewPort = new Rectangle(0,75,stage.stageWidth,stage.stageHeight);
webView.addEventListener(LocationChangeEvent.LOCATION_CHANGE,onURLChange);
webView.loadURL("http://nealdrake.com/mls.html");
addEventListener(ViewNavigatorEvent.REMOVING,onRemove);
}
else {
currentState = "unsupported";
lblSupport.text = "StageWebView feature not supported";
}
}
protected function onURLChange(event:LocationChangeEvent):void
{
trace("URL change");
// Uncomment the following line to load in the default browser instead...
//navigateToURL(new URLRequest(event.location));
}
protected function onRemove(event:ViewNavigatorEvent):void
{
this.webView.dispose();
}
]]>
</fx:Script>
<s:states>
<s:State name="normal"/>
<s:State name="unsupported"/>
</s:states>
<s:Label id="lblSupport" includeIn="unsupported" width="95%" horizontalCenter="0" verticalCenter="0"/>
任何帮助将不胜感激!