UISlider how to set the initial value

前端 未结 2 886
天命终不由人
天命终不由人 2021-01-21 16:19

I\'m pretty new at this iphone dev stuff and i\'m working on some existing code at a company. The uislider i\'m trying to set the initial value on is actually in a UITableViewCe

相关标签:
2条回答
  • 2021-01-21 16:43

    Setting slider.value is the correct way if your linkage is correct (you have made the connections in Interface Builder). If you have created a UISlider in code, all you have to do is set the value property. If that is not working then be sure firstly that the object is "live" (correctly allocated, not released, not out of scope etc.) and secondly that the functions in which you set slider.value are actually being called.

    If you are using Interface Builder and are not sure of how to connect your slider as an IBOutlet, you should check out iTunes University - search for "CS193P" to find some excellent videos from Stanford University. The first couple will take you through making those connections. If using IB and you have not made the connection - nothing will happen.

    0 讨论(0)
  • 2021-01-21 17:02

    PS I had the same issuer - you need to add the UISlide view first then you can change the value.

    0 讨论(0)
提交回复
热议问题