ios - alpha=0 clearColor hidden=YES 有什么区别
高洛峰
高洛峰 2017-04-17 11:21:46
0
1
664

需要临时隐藏一个应用的时候,可能会用到三种办法

view.alpha=0.f;
view.backgroundColor=[UIColor clearColor];
view.hidden=YES;

这三种方法到底有什么区别?从性能上考虑
另外,如果我希望他小时的时候是渐隐的,效率最好的方法是什么?

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(1)
巴扎黑

The literal difference is that view is transparent, the background color of the view is transparent and the entire view is hidden
From a performance point of view, hiding is better, because if it is transparent, the GPU needs to calculate the contents of two layers of views before displaying it

The method of fading is to go from alpha from 1 to 0, and then hide

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!