我有一个使用UIScrollView(包含UIImageView)的iOS应用程序。在缩放缩放并返回1.0之后,当我尝试更改scrollView的contentInset时,它正在更改为另一个值。
如何强制执行contenInset?
myScrollView.contentInsetAdjustmentBehavior=UIScrollViewContentInsetAdjustmentNever;
float offx=0; // it's actually calculated
myScrollView.contentInset = UIEdgeInsetsMake(0, offx, 0, offx);
NSLog(@"Inset just set to:%.0fx%.0f (%.0f)",myScrollView.contentInset.left,myScrollView.contentInset.right,offx);
// The 3 above values are supposed to be aligned
预期结果:插入只设置为:0x0(0)
实际结果:插图设置为:20x20(0)