[英]flex scroller cuts content
有一個小的flex應用程序,其內容是可縮放的。 首先是一些代碼
<s:Scroller verticalScrollPolicy="on" width="100%" height="100%">
<s:Group scaleX="{breite}" scaleY="{hoehe}"
id="mapView" > <!-- zum zoomen -->
<s:Group horizontalCenter="0" id="kartePanel" verticalCenter="0">
<images:karte height="630" width="430" />
<components:akwOnMap data="{biblis}" verticalCenter="{biblis.y}" horizontalCenter="{biblis.x}"
scaleY="{negate}" scaleX="{negate}" toolTip="{biblis.name}"/>
<components:akwOnMap data="{akw2}" verticalCenter="{akw2.y}" horizontalCenter="{akw2.x}"
scaleY="{negate}" scaleX="{negate}" toolTip="{akw2.name}"/>
<components:akwView scaleX="{negate}" data="{akw2}" scaleY="{negate}" verticalCenter="20" horizontalCenter="{80}" >
</components:akwView>
</s:Group>
</s:Group>
</s:Scroller>
通過使用滑塊將值從1更改為3,縮放效果很好。 縮放的中點是容器(地圖)的中心。
我的問題是:縮放時,滾動條會剪切掉部分組。 它會放大到窗口之外嗎?
private function checkScrolling():void
{
var imgWidth:Number = mapView.width * mapView.scaleX;
var imgHeight:Number = mapView.height * mapView.scaleY;
if (mapGroup.contentWidth < imgWidth ||
mapGroup.contentHeight < imgHeight)
{
var excessW:Number = imgWidth - mapGroup.contentWidth;
var excessH:Number = imgHeight - mapGroup.contentHeight;
mapGroup.setContentSize(imgWidth, imgHeight);
/*
if (scroller.horizontalScrollBar)
{
scroller.horizontalScrollBar.minimum = -excessW;
scroller.horizontalScrollBar.maximum = excessW;
mapGroup.horizontalScrollPosition = 0;
}
*/
if (scroller.verticalScrollBar)
{
scroller.verticalScrollBar.minimum = -excessH;
scroller.verticalScrollBar.maximum = excessH;
mapGroup.verticalScrollPosition = 0;
}
這很好。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.