我想创建一个 if 条件来检查我的 ScrollView 是否处于当前旋转状态
self.scrollViewImgView.transform = CGAffineTransformIdentity;
如何通过 if 条件检查是否发生了这种情况?
最佳答案
您可以通过编写以下代码来检查您的 scrollview
的当前方向:-
if (CGAffineTransformIsIdentity(self.scrollViewImgView.transform))
{
NSLog(@"transform is identity and no transformation");
}
else
{
NSLog(@"Rotated/Some transformation made somehow");
}
关于ios - if 语句 (CGAffineTransform) 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24823902/