我正在尝试在Xamarin工作室的应用(评论API)中加入 disqus 。
我现在拥有scrollview
,其中以URL
编程方式添加了一些文字和图片。
我想在scrollview
的底部添加UIWebView,但height
的{{1}}可能不同,因此无法设置。
由于webview
,webview
是否可以更改其大小
(我不希望content size
内有scrollview
,因此无法滚动scrollview
。
我不是在问这个解决方案,只是一些想法,如果可能的话。 感谢
答案 0 :(得分:1)
If it's possible for you to use WKWebView instead of UIWebView, you can implement the same behavior (in terms of loading the URL and it's contents, etc.). WEKWebView exposes the scrollView property.
You can observe the "contentSize" property on that UIScrollView, and adjust your main scroll view's contentSize accordingly. Managing the contentOffset when this happens is a different thing all together.
Since your parent scrollView will always fully contain the webview, it won't scroll, leaving your user to be able to only scroll through the main view.