White spaces using android webview inside scrollvi

2019-05-07 11:20发布

问题:

I'm trying to use a webview inside a scrollview on a layout of my Android app. (with a tabhost also, but it's not important)

it's something like this:

<ScrollView 
    android:layout_height="fill_parent"
    android:layout_width="fill_parent"      
    >

   <LinearLayout 
            android:id="@+id/ll1"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:orientation="vertical">                     

       <WebView 
        android:id="@+id/webview1"
        android:layout_height="wrap_content"
        android:layout_width="fill_parent"
        android:scrollbars="none"   
    />


   </LinearLayout>
</ScrollView>

The problem is that when i try to load a url made using jquery mobile on my webview, it starts to grow to the infinite with a very huge white space below the web content, and the linearlayout and scrollview start to grow too. Is there someone with any solution?

The solution isn't:

  • Changing any layout parameter like layout_with or layout_height on xml layouts.
  • I have to use a webview inside a scrollview because i have to scroll a lot of other things, so it's not a possibility.
  • I really know that this problem comes only with jquery mobile. I've tried to delete de jquery mobile js file from de web, and it went perfect.
  • Also, I know if I load this url on a webview which is not inside a scrollview, there isn't any problem, so the problem is the combination of scrollview, webview and jquery mobile.

Thanks a lot!!!