[英]How do I find the frame of a UIView in the context of a UIScrollView?
我正在尝试放置一个UIPopoverController
来显示何时点击UIButton
。 但是, UIButton
放在UIScrollView
,因此其框架由滚动量偏移。
是否有一种简单的方法可以找到屏幕上下文中出现的视图框架? 或者我只需要在UIButton
框架和UIScrollView
的contentOffset
之间进行减法操作?
谢谢!
如果您正在使用- (void)presentPopoverFromRect:(CGRect)rect inView:(UIView *)view permittedArrowDirections:(UIPopoverArrowDirection)arrowDirections animated:(BOOL)animated
则您已经在指定要从中呈现的视图。 只需在你的UIButton
0,0 0,0的UIButton
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.