Tuesday, February 22, 2011

[android-developers] Re: WebView and Linear Layout

This works for me at its simplest.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">


<WebView
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"/>


</LinearLayout>


On Feb 19, 12:07 pm, Gareth <dr.g.o...@gmail.com> wrote:
> Hi all
>
> I am developing a web app for a tablet.
>
> If I just place a WebView in the layout file it works fine except the
> WebView doesn't fill the whole screen on the tablet.
>
> If I then put the WebView in a Linear Layout on its own - the
> application crashes on start up saying it was forced to close!
>
> Any ideas on how to get a WebView to fill the whole screen?
>
> Thanks
> Gareth
>
> PS - crashing layout file as follows
>
> <?xml version="1.0" encoding="utf-8"?>
> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/
> android"
>     android:orientation="vertical"
>     android:layout_width="fill_parent"
>     android:layout_height="fill_parent">
> <WebView  xmlns:android="http://schemas.android.com/apk/res/android"
>     android:id="@+id/webview"
>     android:layout_width="fill_parent"
>     android:layout_height="fill_parent"
> />
> </LinearLayout>

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate