Search code examples
androidxmlscrollview

Error:(10, 6) Error: The markup in the document following the root element must be well-formed


I have some problems with that ScrollView."element ScrollView must be declared and i dont know what i can do with that markup somebody can help me ?

<?xml version="1.0" encoding="utf-8"?>
    <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"

        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:fillViewport="true"
        android:overScrollMode="never"
        android:scrollbars="none" />

        <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@color/background_color" />

            <ImageView
                android:id="@+id/close_activity"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_gravity="top|end"
                android:layout_margin="4dp"
                android:contentDescription="@string/closebutton"
                android:padding="5dp"
                android:src="@drawable/close" />

            <FrameLayout
                android:id="@+id/frameContainer"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_below="@+id/close_activity" />
        </RelativeLayout>
    </ScrollView>

Solution

  • Don't use self-closing tags with non-empty elements.

    Replace

    android:scrollbars="none" />
    

    with

    android:scrollbars="none">
    

    and

    android:background="@color/background_color"/>
    

    with

    android:background="@color/background_color">
    

    otherwise your XML won't be well-formed.