繁体   English   中英

如何在UIScrollView的上下文中找到UIView的框架?

[英]How do I find the frame of a UIView in the context of a UIScrollView?

我正在尝试放置一个UIPopoverController来显示何时点击UIButton 但是, UIButton放在UIScrollView ,因此其框架由滚动量偏移。

是否有一种简单的方法可以找到屏幕上下文中出现的视图框架? 或者我只需要在UIButton框架和UIScrollViewcontentOffset之间进行减法操作?

谢谢!

如果您正在使用- (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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM