镜像UIView [英] Mirroring UIView

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

问题描述

我有一个 UIView ,它具有透明背景和一些按钮。我想捕获视图的图形,将其缩小,然后在屏幕上的其他位置重绘(镜像)它。 (在另一个视图之上。)按钮可以更改,因此不是静态的。

I have a UIView with a transparent background, and some buttons. I would like to capture the drawing of the view, shrink it, and redraw (mirror) it elsewhere on the screen. (On top of another view.) The buttons can change, so it isn't static.

什么是最好的方法?

推荐答案

检查一个不错的示例代码 http://saveme-dot-txt.blogspot.com/2011/06/dynamic-view-reflection-using.html 在WWDC会议之后。它使用

Check a nice sample code http://saveme-dot-txt.blogspot.com/2011/06/dynamic-view-reflection-using.html following WWDC sessions. It uses

CAReplicatorLayer

用于反射,非常易于实现,并且看起来非常平滑和令人印象深刻。

for reflection, pretty easy to implement and looks really smooth and impressive.

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

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