I am loading an image into an UIWebView with content mode set to aspect fit. I see there is some empty space in the bottom of the UIWebView. Is there a way to find actual image width and height after loading ? I don't see any direct API for this purpose.. I am posting the code which i tried here..
aWebView = [[UIWebView alloc]initWithFrame:mapRect];
aWebView.userInteractionEnabled = YES;
aWebView.backgroundColor = [UIColor clearColor];
aWebView.opaque = NO;
aWebView.scalesPageToFit = YES;
aWebView.delegate = self;
aWebView.scrollView.contentMode = UIViewContentModeScaleAspectFit;
aWebView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[self.view addSubview:aWebView];
NSURL *url = [NSURL URLWithString:urlText];
NSURLRequest *urlRequest = [[NSURLRequest alloc]initWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:120];
[aWebView loadRequest:urlRequest];
aWebView.scrollView.delegate = self;
aWebView.delegate = self;
Note: The image is loading from remote server. This is a Native iOS application that is targetted for both iOS 7 and iOS 8.
Thanks..