gpt4 book ai didi

apache-flex - 柔性 : HSlider - Set different skins for different thumbs?

转载 作者:行者123 更新时间:2023-12-04 02:52:43 26 4
gpt4 key购买 nike

我将使用 HSlider 来设置一系列值。我希望左手拇指看起来像 ( ,右手拇指像 ) 这样它们似乎包含了像 (range) 这样的范围而不是 |range|。我只知道如何为 SliderThumb 设置皮肤,这将为两者设置皮肤。有谁知道为每个拇指设置不同皮肤的方法吗?

谢谢。

更新

我现在有这段代码:

<?xml version="1.0" encoding="utf-8"?>
<mx:HSlider xmlns:mx="http://www.adobe.com/2006/mxml">

<mx:Style>
.thumbTickLeft
{
disabledSkin: Embed(source="skins.swf", symbol="thumbTickLeft_disabledSkin");
downSkin: Embed(source="skins.swf", symbol="thumbTickLeft_downSkin");
overSkin: Embed(source="skins.swf", symbol="thumbTickLeft_overSkin");
upSkin: Embed(source="skins.swf", symbol="thumbTickLeft_upSkin");
}
.thumbTickRight
{
disabledSkin: Embed(source="skins.swf", symbol="thumbTickRight_disabledSkin");
downSkin: Embed(source="skins.swf", symbol="thumbTickRight_downSkin");
overSkin: Embed(source="skins.swf", symbol="thumbTickRight_overSkin");
upSkin: Embed(source="skins.swf", symbol="thumbTickRight_upSkin");
}
</mx:Style>

<mx:Script>
<![CDATA[
override protected function commitProperties():void
{
super.commitProperties();

updateThumbSkins();
}

private function updateThumbSkins():void
{
this.getThumbAt(0).setStyle('styleName','thumbTickLeft');
this.getThumbAt(1).setStyle('styleName','thumbTickRight');
}
]]>
</mx:Script>


</mx:HSlider>

拇指勾号根本不显示?顺便说一句,我已确保皮肤正确加载,因为我可以将它们设置为这样的按钮:

<mx:Button styleName="thumbTickRight"/>

最佳答案

好吧,我能够让它以这种方式工作..不确定这是否是最好的方式。

<?xml version="1.0" encoding="utf-8"?>
<mx:HSlider
xmlns:mx="http://www.adobe.com/2006/mxml"
sliderThumbClass="RangeSliderThumb"
creationComplete="initThumbs()">

<mx:Script>
<![CDATA[
import mx.controls.sliderClasses.SliderThumb;

[Embed(source="skins.swf", symbol="thumbTickLeft_upSkin")]
private var leftUp:Class;

[Embed(source="skins.swf", symbol="thumbTickRight_upSkin")]
private var rightUp:Class;

[Embed(source="skins.swf", symbol="thumbTickLeft_downSkin")]
private var leftDown:Class;

[Embed(source="skins.swf", symbol="thumbTickRight_downSkin")]
private var rightDown:Class;

[Embed(source="skins.swf", symbol="thumbTickLeft_overSkin")]
private var leftOver:Class;

[Embed(source="skins.swf", symbol="thumbTickRight_overSkin")]
private var rightOver:Class;

[Embed(source="skins.swf", symbol="thumbTickLeft_disabledSkin")]
private var leftDisabled:Class;

[Embed(source="skins.swf", symbol="thumbTickRight_disabledSkin")]
private var rightDisabled:Class;

private function initThumbs():void
{
this.thumbCount = 2;

var thumb1:SliderThumb = this.getThumbAt(0);
thumb1.setStyle("thumbUpSkin", leftUp);
thumb1.setStyle("thumbDownSkin", leftDown);
thumb1.setStyle("thumbOverSkin", leftOver);
thumb1.setStyle("thumbDisabledSkin", leftDisabled);

var thumb2:SliderThumb = this.getThumbAt(1);
thumb2.setStyle("thumbUpSkin", rightUp);
thumb2.setStyle("thumbDownSkin", rightDown);
thumb2.setStyle("thumbOverSkin", rightOver);
thumb2.setStyle("thumbDisabledSkin", rightDisabled);
}
]]>
</mx:Script>

</mx:HSlider>

关于apache-flex - 柔性 : HSlider - Set different skins for different thumbs?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1069457/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com