我有一堆滑块,我正在尝试对其应用自定义拇指。它的尺寸是 12x20,我使用合成器外观和下面的代码来应用它。这会正确显示水平滑块的拇指,但是一旦我制作垂直滑块,拇指就会在边缘变形。有没有更好的方法来做到这一点?另外,拇指按下的代码没有做任何事情,我认为原因是sliderThumbs没有“按下状态”?有没有办法在按下滑块时改变 L&F?先谢谢了!!!
干杯,卢卡斯
<!-- Make and Bind a SliderThumb style -->
<style id="sliderStyle">
<state>
<property key="Slider.paintValue" type="boolean" value="false"/>
<property key="Slider.thumbWidth" type="integer" value="12"/>
<property key="Slider.thumbHeight" type="integer" value="21"/>
</state>
</style>
<bind style="sliderStyle" type="region" key="slider" />
<style id="SliderTrackStyle">
<opaque value="FALSE"/>
</style>
<bind style="SliderTrackStyle" type="region" key="sliderTrack" />
<style id="sliderThumbStyle">
<state>
<imagePainter method="sliderThumbBackground" path="Images/SliderThumb.png"
sourceInsets="0 0 0 0"/>
</state>
<state value="PRESSED">
<imagePainter method="sliderThumbBackground" path="Images/SliderThumbPressed.png"
sourceInsets="0 0 0 0"/>
</state>
</style>
<bind style="sliderThumbStyle" type="region" key="sliderThumb" />