UIToolbar not transparent on iPad2

烂漫一生 提交于 2020-01-25 11:56:09

问题


This has been driving me nuts.

I have a toolbar on my iPAD application and its translucent property is set to 'YES'. I am doing this in my storyboard:

When I run on an iPad Air things look good. However if I run on an iPad 2 the toolbar is not translucent. I experience the same problem in the simulator and on an actual device.

This is also not a problem across different versions of the OS. IE no matter what OS I run (iOS 7 or iOS 8) its wrong on an iPad 2 but correct on an iPad Air.

Why????

Is there anything I can do to get a consistent L&F across these devices?


回答1:


Translucency - which uses blur - is computationally expensive.

If you compare the control panel or notification menu between iPad 2 and iPad Air, - you will see that Apple has disabled translucency on the lower powered device as it can't really cope.

That applies to iPad2, iPad3, iPad mini and maybe some older iPhones and iPod Touches. Even higher-powered devices can give poor results if you over-use these effects.

If you need a completely consistent look and feel, you should resist using properties that take advantage of translucency and blur effects. Another option is to play around with view alpha, background colour and tint to get a semi-tranparent look on devices that don't support translucency.

For more information on device support for UIVisualEffect, which seems to coincide with 'translucency' property support on UI objects:

Check if device supports blur
Detect if device properly displays UIVisualEffectView?



来源:https://stackoverflow.com/questions/30178756/uitoolbar-not-transparent-on-ipad2

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