玻璃效果UIView [英] Glass effects UIView

查看:92
本文介绍了玻璃效果UIView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何在UIView上添加玻璃效果

I would like to know how it is possible to add a glass effect on a UIView

我想在灰色半透明视图上类似的效果,您可以在这里看到:

I would like something like this effects on the gray translucent view you can see here :

< img src = https://i.stack.imgur.com/VJhsX.png alt =在此处输入图片描述>

谢谢

推荐答案

UIView中没有玻璃效果。您所能做的就是将视图的不透明度设置在0到1之间。精美的图像集,使其看起来像是玻璃效果。

There's nothing like glass effect in UIView .All you can do is set the opacity of the view between 0 and 1.Also the view shown above has fine set of images which makes it seem like your "Glass Effect".

好吧,如果您将UIView定义为闪亮而优雅,则可以一分为二方式:-

Well If you what your UIView to be "shiny and elegant" , you can do it in two ways :-

1>您可以简单地在用photoshop创建的图像中产生效果,因为这样可以减少编程时的开销。

1>You can simply have effects in images created with photoshop as it will decrease the overhead of doing the same with programming.

2>您可以使用apple提供的core-Graphics库获得它那么您可能必须进入更复杂的绘画世界,并查看获得光泽效果的教程

2>you can have it using core-Graphics library provided by apple then you might have to get into a more complex world of drawing and see the Tutorial to get Gloss Effect

光泽按钮,由Ray wendelich

关于光泽按钮的另一个教程

这篇关于玻璃效果UIView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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