How to determine the content size of a UIWebView?

后端 未结 15 2131
灰色年华
灰色年华 2020-11-22 17:06

I have a UIWebView with different (single page) content. I\'d like to find out the CGSize of the content to resize my parent views appropriately. T

15条回答
  •  一个人的身影
    2020-11-22 17:29

    Also in iOS 7 for proper working of all of mentioned methods add this in your view controller viewDidLoad method:

    if ([self respondsToSelector:@selector(automaticallyAdjustsScrollViewInsets)]) {
        self.automaticallyAdjustsScrollViewInsets = NO;
    }
    

    Otherwise neither of methods would work as it should.

提交回复
热议问题