Monday, October 23, 2023
HomeiOS Developmentios - Constraints a view to the underside of WKWebView.scollView

ios – Constraints a view to the underside of WKWebView.scollView


I’m making an attempt to place a view on the backside of the contentView of my WkWebView.scrollView, but it surely looks like the view at all times find yourself on the origin Y of 5000 or 8000 which is the random worth of certain contained in the WkWebView.

I attempted setting body, however resulted the identical factor.

I ponder if you happen to can really put a view precisely after the contentView of the webView ended whereas nonetheless making the scrolling works?

self.webView.body = self.view.bounds;
[self.webView.scrollView addSubview:self.myView];
self.myView.translateAutoresizingMaskIntoConstraints = false;
[self.myView.topAnchor constraintEqualToAnchor:self.webView.scrollView.subViews.lastObject.bottomAnchor].energetic = true;
[self.myView.bottomAnchor constraintEqualToAnchor:self.webView.scrollView.bottomAnchor].energetic = true;
[self.myView.widthAnchor constraintEqualToAnchor:self.view.widthAnchor].energetic = true;



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments