代码之家  ›  专栏  ›  技术社区  ›  asawilliams

带Degrafa的Skining Horizontallist滚动条

  •  0
  • asawilliams  · 技术社区  · 15 年前

    我在尝试用degrafa将滚动条剥皮到水平面上时遇到了一些问题。滚动条根本不显示。我检查了一下滚动条是否应该在没有剥皮的情况下出现,确实如此。这样做有什么问题吗? 下面是一些代码:

    这就是我定义水平滚动条的地方

    <mx:HorizontalList horizontalScrollBarStyleName="thumbnailScrollbar"/>
    

    这里是我为皮肤定义类引用的地方(箭头为空,因此它们不会出现)。

    .thumbnailScrollbar
    {
        up-arrow-skin:      ClassReference(null);
        down-arrow-skin:    ClassReference(null);
        trackSkin:      ClassReference("ScrollBarTrackSkin");
        thumbSkin:      ClassReference("ScrollBarThumbSkin");
    }
    

    滚动Bartrackskin:

    <?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>
    

    滚动条缩略图:

    <?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,就像我在移除蒙皮时滚动条出现之前所说的那样。

    1 回复  |  直到 15 年前
        1
  •  2
  •   Glenn    15 年前

    你的光头和滑膛在哪里?通常,degrafa示例在皮肤中执行类似的操作以更新高度/宽度:

    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滚动条外观中有一些黑客代码,我的条也没有出现。

    但我目前还没有用德格拉法做我的皮肤,所以可能还有另外一个问题。我面前没有任何例子。