-(void) addobserverforwebviewcontentsize{ [Self.webView.scrollView addobserver:self Forkeypath: @ "contentsize" options:0 context:nil];} -(void) removeobserverforwebviewcontentsize{ [Self.webView.scrollView removeobserver:self Forkeypath:@ "contentsize"];}
- (void) Observevalueforkeypath: (NSString *) KeyPath Ofobject: (ID)ObjectChange: (nsdictionary *) Change context: (void*) context{//Add your code to the side here[self Layoutcell];}//set a reasonable location for Footerview- (void) layoutcell{//Cancel the listener, as this will adjust the contentsize to avoid infinite recursion[self removeobserverforwebviewcontentsize]; Cgsize contentsize=self.webView.scrollView.contentSize; Self.btnView.frame= CGRectMake (0, Contentsize.height, ScreenWidth, -); [Self.webView.scrollView AddSubview:self.btnView]; Self.webView.scrollView.contentSize= Cgsizemake (contentsize.width, Contentsize.height + -); //re-listen[self addobserverforwebviewcontentsize];}
-(Agreebtncell *) btnview{ if (! _btnview) { = [Agreebtncell cell]; } return _btnview;}
Objective-c UIWebView Add a foot view