当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - SliderIOS – custom moveable image

问题描述:

I'm using react-native and for a component I need to replace the default image of the SliderIOS component with a custom one. Is there any way of accomplishing this or should I create a custom slider component? (I don't have any experience in this.)

I have already tried embedding an image as a child of the slider as well as the vice-versa approach, however non of them have worked.

网友答案:

Looking at the source code for RCTSliderManager, we can see that it only exposes value, maximumValue, minimumValue, minimumTrackTintColor and maximumTrackTintColor. That means like it looks like you're out of luck. You could use the RCTSlider and RCTSliderManager files as a starting point for a custom component, or you could create a pull request to expose setThumbImage on UISlider.

网友答案:

I have created a pull request fixing this issue which hopefully gets accepted.

分享给朋友:
您可能感兴趣的文章:
随机阅读: