How to add controls beneath a UIWebView

后端 未结 3 630
情话喂你
情话喂你 2021-02-03 13:07

What\'s the simplest, fastest, or otherwise (objectively) best way to add a couple of controls (e.g. some UIButtons) beneath a UIWebView?

To be clear, I\'d like to displ

3条回答
  •  暖寄归人
    2021-02-03 13:46

    This is how i do it.

    - (void)webViewDidFinishLoad:(UIWebView *)webView {
    
    
    for(UIView *view in [webView subviews]){
    
        if([view isKindOfClass:[UIScrollView class]]){
            NSLog(@"Scrollview found with tag %d", [view tag]);
    
            UIScrollView *scroll= (UIScrollView *)view;
            [scroll addSubview:self.finishBtn];
            [finishBtn setCenter:CGPointMake(webView.center.x, scroll.contentSize.height-30)];
        }
    
    
    }
    

    }

提交回复
热议问题