UIScrollView contentInset在设置后发生变化

时间:2018-05-07 19:41:45

标签: ios objective-c uiscrollview

我有一个使用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)

0 个答案:

没有答案