Im updating a UIProgressView called “ammo”. When i update the progress the UIProgressView disappears from the UIView like its being hidden or moved behind another view.
Code
- (void)updateAmmo:(float) inputAmmo capacity:(float)inputCapacity{
//Calculate the progress value
float value = inputAmmo/inputCapacity;
//If nothing has changed don’t update
if(value != ammo.progress){
[ammo setProgress:value];
}
}
Things I have checked
Logging value extracts
Thanks in advance for any assistance.
if u use IB for progress creation checkout ur connect with them.
i suspect about ur value property goes to immediately to 0 or below 0
- (void)updateAmmo:(float) inputAmmo capacity:(float)inputCapacity{
float value = inputAmmo/inputCapacity;
if(value != [ammo progress]){
[ammo setProgress:value];
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.