向UIToolBar / UINavigationBar / UITabBar添加图层蒙版会破坏半透明效果 [英] adding a layer mask to UIToolBar/UINavigationBar/UITabBar breaks translucency

查看:123
本文介绍了向UIToolBar / UINavigationBar / UITabBar添加图层蒙版会破坏半透明效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将我的UI升级到iOS 7,并且一直使用自定义标签栏,其中CAShapeLayer用作蒙版。我一直试图通过在下面有一个UIToolBar来添加动态模糊,但是如果我尝试在工具栏上设置layer.mask属性,则半透明度已经消失,我只是半透明(但当然是屏蔽工作)。有没有办法让这个工作?在向这些类添加子视图时,我也看到了这种行为。

Im upgrading my UI to iOS 7, and have been using a custom tab bar which has a CAShapeLayer used as a mask. Ive been trying to add dynamic blur by having a UIToolBar underneath, but if i try setting the layer.mask property on the toolbar translucency is gone, and i just have it semi transparent (but masking works of course). Is there a way to get this working? Ive also seen this behavior when adding a subview to these classes.

推荐答案

如果半透明消失意味着它变得完全透明如果你只是在模拟器上测试,它是一个已知的模拟器错误。如果您在设备上运行它,它应该按预期工作。

If "translucency is gone" means it becomes totally transparent and if you tested just on simulator, it is a known bug of simulator. If you run it on devices, it should work as expected.

这篇关于向UIToolBar / UINavigationBar / UITabBar添加图层蒙版会破坏半透明效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆