我将旋转并调整视图(UIImageView)的大小,使其不会超出 supverview。所以我写了以下。
//rotating and resizing process
//testing subview is in superview
CGRect rect = subview.bounds;
CGRect converted_rect = [subview convertRect:rect toView:subview.superview];
if(!CGRectContainsRect(subview.superview.frame, converted_rect))
{
//restore proccess
}
但我的代码不能阻止走出 superview 区域。