缩放转换完成后,子视图被其父视图剪切 - 目标 C
我的项目涉及屏幕中的 4 个独立视图。在这种情况下,苹果文档规定我们只有一个视图控制器和 4 个 NSObject 来控制不同的视图。我没有使用 Interface builder 来创建视图和 NSObject,而是通过编程方式声明。在其中一个视图中,我使用 imageview 作为子视图加载了所有图像。
我想做的是尝试一些类似于 Mac os Dock 的动画。触摸时放大。
问题是当我缩放图像时 当视图被触摸时。我用过 CATransform3dMakeScale。我的图像视图 被父视图剪切。 你能帮我解决这个问题吗?我想我 一定错过了一些标志。
我尝试了 Clipstobounds 和调整标志大小。什么都不起作用。
我怀疑问题是否可能是由于以下原因造成的,但我不知道如何调试它
1)因为我在没有使用 viewcontroller 的情况下创建了 NSObject。我是否错过了在 loadView 或 init 方法期间自动设置的任何标志。 2)我也怀疑我使用NSObject的方式是否正确。
谢谢
My project involves 4 independent views in screens. In this case,apple documentation states us to have only one viewcontroller and have 4 NSObject to control the different views.I didnt use Interface builder to create the views and NSObject, I didnt by declaring programmatically. In one of the view I have all my images loaded up using imageview as their subview.
What I`m trying to do is trying some animation similar to mac os dock like animation. zooming in when touched.
Problem is when i`m zooming the images
when the view is being touched. I used
CATransform3dMakeScale. My imageview
is being clipped by the parent view.
Can you help me out in this. I guess I
must have missed some flag.
I trid clipstobounds, and resizing flags. Nothing works.
My suspection whether the problem may be because of the following reasoens but i don`t know how to debug it
1) Since I created NSObject without using viewcontroller. Did I miss any of the flags that will be automatically set during loadView or init method.
2) I also have doubt whether the way in which I have used the NSObject is correct or not.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了这个问题的答案。我的子视图位于另一个背景为透明颜色的视图下方。因此它似乎被剪辑了。我通过使用 [uiview Bringsubviewtofrom:] 解决了这个问题
I found answer for this. My subview was below another view whose background was clear color. Hence it appeared to be clipped. I cleared this problem by using [uiview bringsubviewtofrom:]