iPhone ProgressBar

前端 未结 3 816
轮回少年
轮回少年 2021-02-03 16:33

How can I change the color as well as size of UIProgressBar in iPhone SDK

3条回答
  •  一向
    一向 (楼主)
    2021-02-03 17:04

    As Can noted, there is very little customization available for UIProgressView... pretty sucky. The solution I just implemented was to hack a UISlider. Here's the inspiration, from Apple's support forum.

    1. Create a new UISlider
    2. Set the setMinimumTrackImage and setMaximumTrackImage to your desired UIImage values
    3. Set the setThumbImage to nil
    4. Set the upper and lower bounds of the slider

    Once this is setup and added to your UIView, use your custom method to set the value of the slider to the value you would normally have assigned to the UIPRogressView's progress.

提交回复
热议问题