UISlider ignores alpha when set to 0.5

一曲冷凌霜 提交于 2019-12-03 12:48:31

As you said that other UI controllers work with 0.5 alpha, there should be no difference with UISlider, since they inherit alpha property from UIView class and there is reference to the opaque property ("You should always set the value of this property to NO if the view is fully or partially transparent"). Maybe you can try to follow the advice.

If there's really a bug with 0.5 value, you can simply change your starting transparency from 0.4 to 0.41/0.39 w/o any visible difference:

slider.alpha = 0.41f + (CGFloat)i / 10.0f;

Finally, you can output the resulting alpha values to some labels to check if they are the expected ones or output the (CGFloat)i value to see if something wrong with type casting.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!