UIWebview scrollview无缘无故地更改内容 [英] UIWebview scrollview changes contentsize for no reason
问题描述
我有一个加载uiwebview的uiviewcontroller。当uiviewcontroller加载uiwebview时,一切都正确完成。但是当一个导航并返回并且未加载uiwebview时,它将以不同方式显示。 uiwebview scrollview的内容高度改变了64px,它变得更高。
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
当一个人返回视图时,会发生这种情况
When one returns back to the view, this is what happens
我希望我能够解决我的问题。如果需要更多细节,我可以提供更多。谢谢
I hope I was able to make my problem understandable. If more details are necessary, I am able to give more. Thank you
推荐答案
我有类似的问题,请在 viewDidLoad $ c $中尝试此代码c>方法。
I had a similar problem, try this code in your viewDidLoad
method.
if([self respondsToSelector:@selector(setAutomaticallyAdjustsScrollViewInsets:)])
self.automaticallyAdjustsScrollViewInsets = NO;
这篇关于UIWebview scrollview无缘无故地更改内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!