UIWebview scrollview changes contentsize for no re

2019-05-08 02:05发布

I have a uiviewcontroller which loads a uiwebview. When the uiviewcontroller loads the uiwebview everything is done correctly. But when one navigates away and returns back and the uiwebview is not loaded, it is displayed differently. The uiwebview scrollview's contentsize height changes by 64px, it gets higher.

When it is loaded for the first it looks like this enter image description here

When one returns back to the view, this is what happens

enter image description here

I hope I was able to make my problem understandable. If more details are necessary, I am able to give more. Thank you

2条回答
2楼-- · 2019-05-08 02:22

I had a similar problem, try this code in your viewDidLoad method.

if([self respondsToSelector:@selector(setAutomaticallyAdjustsScrollViewInsets:)])
    self.automaticallyAdjustsScrollViewInsets = NO;
查看更多
相关推荐>>
3楼-- · 2019-05-08 02:28

You can do like this.
- (void) viewDidLoad { [super viewDidLoad]; self.automaticallyAdjustsScrollViewInsets = NO; }

查看更多
登录 后发表回答