我有一堆滑块,我正在尝试应用一个自定义的拇指。它的尺寸是12x20,我使用下面的代码使用synth外观来应用它。这可以正确地显示水平滑块的拇指,但是一旦我做了一个垂直的滑块,拇指的边缘就会变形。有没有更好的方法来做到这一点?另外,拇指按下的代码没有做任何事情,我认为原因是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" />发布于 2011-04-12 17:23:21
使用矢量图形。在我的一个应用程序上,我最初使用的是png文件,和你一样。当我切换到矢量图形时,在较小的按钮上使用时,边缘不会撕裂。
https://stackoverflow.com/questions/3695761
复制相似问题