【问题标题】:Error:(10, 6) Error: The markup in the document following the root element must be well-formed错误:(10, 6) 错误:文档中根元素之后的标记必须格式正确
【发布时间】:2017-11-19 20:39:34
【问题描述】:

我对那个 ScrollView 有一些问题。“必须声明元素 ScrollView,我不知道我可以用那个标记做什么,有人可以帮助我吗?

<?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>

【问题讨论】:

    标签: android xml scrollview


    【解决方案1】:

    不要在非空元素中使用自闭标签。

    替换

    android:scrollbars="none" />
    

    android:scrollbars="none">
    

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

    android:background="@color/background_color">
    

    否则您的 XML 格式将不正确。

    【讨论】:

    • 只是 以红色突出显示并且不起作用;/
    • @kubade220:如果您在我对您发布的 XML 的回答中列出了两个更改,那么它将是格式正确的。如果您仍然遇到问题,如果您需要进一步的帮助,您必须清楚您的新 XML 究竟是什么样的(编辑您的问题并添加它)。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-03
    • 1970-01-01
    • 2014-08-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多