Pre Exam Test Practice (SSC | Banking | IAS | GATE | State Level | CLAT | Railways | Insurance | Teaching Exams | NDA | Defence | IES |State Exam )

Organizational Research By

Surprising Reserch Topic

get uiwebview contents height using -'ios,uiwebview,height,xcode4.3'

get uiwebview contents height  using -'ios,uiwebview,height,xcode4.3'

I have a uiwebview that loads data using the loadHtmlString function.The thing is i am loading the data from an sqlite database, each time i load a different string with different length and naturally the web view obtains different height.Now i need to know each time the exact height of the uiwebview in order to load an imageView right under the webView.
I have tried

- (void)webViewDidFinishLoad:(UIWebView *)aWebView {
    CGRect frame = aWebView.frame;
    frame.size.height = 1;
    aWebView.frame = frame;

    CGSize fittingSize = [aWebView sizeThatFits:CGSizeZero];
    frame.size = fittingSize;
    aWebView.frame = frame;

    NSLog(@"Size: %f, %f", fittingSize.width, fittingSize.height);

but i always get the same result. I need to know how can i get dynamically the height of web view each time it is loaded. Thx

asked Sep 7, 2015 by rajesh
0 votes

Related Hot Questions

Government Jobs Opening