我遇到了一些问题,当我试图皮肤的滚动条上的horizontalList与Degrafa。滚动条根本不显示。我检查了一下滚动条是否应该在没有皮肤的情况下显示,它确实出现了。这样做有什么问题吗?下面是一些代码:
这就是我定义HorizontalList的地方,我想要一个带皮肤的滚动条
<mx:HorizontalList horizontalScrollBarStyleName="thumbnailScrollbar"/>
这里是我为皮肤定义ClassReference的地方(箭头为空,这样它们就不会出现)。
.thumbnailScrollbar
{
up-arrow-skin: ClassReference(null);
down-arrow-skin: ClassReference(null);
trackSkin: ClassReference("ScrollBarTrackSkin");
thumbSkin: ClassReference("ScrollBarThumbSkin");
}
ScrollBarTrackSkin:
<?xml version="1.0" encoding="utf-8"?>
<GraphicBorderSkin xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns="http://www.degrafa.com/2007">
<fills>
<SolidFill id="upFill" color="#FFFFFF" alpha="0.8"/>
</fills>
<geometry>
<RoundedRectangle id="track" x="-8" cornerRadius="16" width="{this.skinWidth}" height="{this.skinHeight}" fill="{upFill}"/>
</geometry>
</GraphicBorderSkin>
ScrollBarThumbSkin:
<?xml version="1.0" encoding="utf-8"?>
<GraphicBorderSkin xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns="http://www.degrafa.com/2007">
<fills>
<SolidFill id="background" color="#333333" alpha=".8"/>
</fills>
<geometry>
<RoundedRectangle id="thumb" cornerRadius="16" width="{this.skinWidth}" height="{this.skinHeight}" fill="{background}"/>
</geometry>
</GraphicBorderSkin>
我在HorizontalList中填充了比可见的更多的项目,就像我之前说过的那样,当我移除皮肤时滚动条就会出现。
发布于 2009-10-13 02:56:25
您的skinHeight和skinWidth设置在哪里?通常,降级示例在皮肤中执行以下操作来更新高度/宽度:
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
super.updateDisplayList(unscaledWidth, unscaledHeight);
awidth = unscaledWidth;
aheight = unscaledHeight;
}除此之外,我还需要这样做:
override public function get measuredWidth():Number {return 16; }
override public function get measuredHeight():Number {return 10;}在我的滚动条皮肤,以获得我想要的高度和宽度。(对于V和H,在内部进行旋转时相同)。Flex滚动条皮肤中有一些粗糙的代码,我的条形图也没有显示出来。
但我目前没有对我的皮肤使用降解剂,所以可能还有另一个问题。我面前没有任何例子。
https://stackoverflow.com/questions/1545977
复制相似问题