简体   繁体   English

如何将视图框架转换为超视图?

[英]How do I transpose a view's frame to it's superview?

Not even sure how to ask this. 甚至不确定如何问这个问题。 Transpose local coordinates to global? 将本地坐标转换为全局坐标?

The UIView class has a handful of methods for converting coordinates of CGPoints or CGRects from one view to another. UIView类有一些方法可以将CGPoints或CGRects的坐标从一个视图转换为另一个视图。 Take a look at convertPoint:toView:, convertPoint:fromView:, etc in the UIView class reference. 在UIView类引用中查看convertPoint:toView:,convertPoint:fromView:等

You can convert coordinates from one view to another or from any view to the window or vice versa. 您可以将坐标从一个视图转换为另一个视图,也可以从任何视图转换为窗口,反之亦然。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在UIView中获取不是superview的视图框架 - Get view's frame in UIView that is not superview 如何在Superview的视图中插入视图? (iOS) - How to Insert View in Superview's View? (iOS) 如何通过自动调整大小使UICollectionView填充其超级视图? - How do I make a UICollectionView fill it's superview with autosizing? 如何让图层的帧根据其超级层的帧或其视图的帧自动调整大小? - how do i get a layer's frame to automatically resize based on its superlayer's frame or its view's frame? 如何使CAShapeLayer的框架面对其超级视图? - How to get CAShapeLayer's frame confront to its superview? 超级视图将子视图置于最前面是行不通的。 怎么做? - It's not working that superview bring the subview to front. how to do it? 从SuperView中删除视图后,该视图不具有动画效果 - View is not animated when it's removed from superView 在Superview中隐藏视图的路径以显示SuperSupervView - Mask a View's Path in It's Superview To Reveal It's SuperSupervView 如何在iOS中获得UIView的超级视图的UIViewController? - How to get UIViewController of a UIView's superview in iOS? 如何/如何手动更改自定义UIView的框架? - How/Do I change a custom UIView's frame manually?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM