I have a UITableView
and I want to add a UIView
as a footer. This UIView
has a UIWebView
and a UIButton
. I have the following code:
- (void)viewWillAppear:(BOOL)animated {
CGRect frame = CGRectMake(10, 0, 280, 400);
self.webViewContent = [[UIWebView alloc] initWithFrame:frame];
self.webViewContent.delegate = self;
self.webViewContent.hidden = YES;
}
- (void)webViewDidFinishLoad:(UIWebView *)webView {
UIView *viewA = [[UIView alloc] initWithFrame:CGRectMake(webView.bounds.origin.x, webView.bounds.origin.y, webView.bounds.size.width+20, webView.bounds.size.height + firstFrameY)];
viewA.backgroundColor = [UIColor yellowColor];
[viewA addSubview:self.webViewContent];
[viewA addSubview:linkButton];
[self.emailDetailsTableView setTableFooterView:viewA];
}
The output is that I can see everything except the UIWebView
.
However, if I test the following code
- (void)webViewDidFinishLoad:(UIWebView *)webView {
UIView *viewA = [[UIView alloc] initWithFrame:CGRectMake(webView.bounds.origin.x, webView.bounds.origin.y, webView.bounds.size.width+20, webView.bounds.size.height + firstFrameY)];
viewA.backgroundColor = [UIColor yellowColor];
//[viewA addSubview:self.webViewContent];
[viewA addSubview:linkButton];
[self.emailDetailsTableView setTableFooterView:self.webViewContent];
}
I can see the UIWebView
. Please note that I commented the line where I was adding the UIWebView
to the UIView
. If I uncomment the line, I don't see the UIWebView
!!!
Any ideas concerning what I'm doing wrong?
Thanks.