Webview in Scrollview

后端 未结 6 875
南旧
南旧 2020-11-29 02:40

I have to place WebView into ScrollView. But I have to put some views into the same scrollview before webview. So it looks like this:



        
6条回答
  •  独厮守ぢ
    2020-11-29 03:24

    use:

    android:descendantFocusability="blocksDescendants"
    

    on the wrapping layout this will prevent the WebView from jumping to its start.

    use:

    webView.clearView();
    mNewsContent.requestLayout();
    

    every time you change the WebView size to invalidate the layout, this will remove the empty spacing.

提交回复
热议问题