0

I create a fragment sample in Android Studio

and delete the label and add the webview look like:

   <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"
    tools:context=".MainActivity$DummySectionFragment">


    <WebView
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:id="@+id/webView"
            android:layout_margin="0dp"
            android:layout_alignParentRight="true"/>

</RelativeLayout>

enter image description here

And it has the margin on the webview..

So, how can I make the webview fill the dragment?

1
  • Can you make your question a bit clearer? Are you trying to get rid of the margins so the web view fills the whole fragment?
    – Nick
    May 28, 2013 at 4:52

1 Answer 1

4

Remove these lines from RelativeLayout:

android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin"

1
  • Yeah! Also in your web view, try by removing this: android:layout_margin="0dp" I don't think you need it
    – Homam
    May 28, 2013 at 5:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.