Android webview height doesn't fill in the screen size



I am developing an android app for a videogame website and I need to make a tabbed layout. In each tab there must be a webview because I have to load on it some apposite php pages I have created.


onCreate code here


The first tab has a webview formatted in this way:



<LinearLayout xmlns:android="http://ift.tt/nIICcg"
xmlns:tools="http://ift.tt/LrGmb4"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.leaderboardmk8.MainActivity" >

<WebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent" />

</LinearLayout>


And it looks like this. The 2nd tab has this XML code:



<LinearLayout xmlns:android="http://ift.tt/nIICcg"
xmlns:tools="http://ift.tt/LrGmb4"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.leaderboardmk8.MainActivity" >

<WebView
android:id="@+id/webview2"
android:layout_width="match_parent"
android:layout_height="match_parent" />

</LinearLayout>


For some reason this webview2 looks like this: as you can see there's only a small part of the WebView component on the top. I don't know where is the problem because I typed:



android:layout_width="match_parent"
android:layout_height="match_parent"


Do you have any suggestion?


No comments:

Post a Comment