gpt4 book ai didi

java - DrawerLayout - 文档中根元素后面的标记必须格式正确

转载 作者:行者123 更新时间:2023-12-01 13:45:50 25 4
gpt4 key购买 nike

我收到一条错误消息,指出根元素后面的文档中的标记必须格式正确。我不确定为什么会发生这种情况 - 我相信我已经正确格式化了所有内容。

XML:

   <?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<!-- The main content view -->

<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<!-- The navigation drawer -->

<ListView
android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#111"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp" />

</android.support.v4.widget.DrawerLayout><com.google.android.youtube.player.YouTubePlayerView
android:id="@+id/youtubeplayerview"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<com.idg.omv.ui.widget.VideosListView
android:id="@+id/videosListView"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<RelativeLayout
android:id="@+id/footer"
android:layout_width="fill_parent"
android:layout_height="70dip"
android:layout_alignParentBottom="true" >

<HorizontalScrollView
android:id="@+id/groupScrollView"
android:layout_width="fill_parent"
android:layout_height="match_parent" >

<ImageView
android:id="@+id/selstation_up_btn"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:background="@color/darkgrey"
android:scaleType="fitXY"
android:src="@drawable/selstation_up_btn" />
</HorizontalScrollView>

<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:src="@drawable/scroll_lt_arrow" />

<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:src="@drawable/scroll_rt_arrow" />

<android.support.v4.view.ViewPager
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />

</RelativeLayout><android.support.v4.widget.Drawer

</android.support.v4.widget.DrawerLayout>

最佳答案

android.support.v4.widget.DrawerLayout 是您的最外层父级,因此您只需在文件末尾关闭,所有您的 subview 必须仅放置在 android.support.v4.widget.DrawerLayout 内。

试试这个:

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<!-- The main content view -->

<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<!-- The navigation drawer -->

<ListView
android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#111"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp" />



<com.google.android.youtube.player.YouTubePlayerView
android:id="@+id/youtubeplayerview"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<com.idg.omv.ui.widget.VideosListView
android:id="@+id/videosListView"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<RelativeLayout
android:id="@+id/footer"
android:layout_width="fill_parent"
android:layout_height="70dip"
android:layout_alignParentBottom="true" >

<HorizontalScrollView
android:id="@+id/groupScrollView"
android:layout_width="fill_parent"
android:layout_height="match_parent" >

<ImageView
android:id="@+id/selstation_up_btn"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:background="@color/darkgrey"
android:scaleType="fitXY"
android:src="@drawable/selstation_up_btn" />
</HorizontalScrollView>

<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:src="@drawable/scroll_lt_arrow" />

<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:src="@drawable/scroll_rt_arrow" />

<android.support.v4.view.ViewPager
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />

</RelativeLayout><RelativeLayout>

</RelativeLayout>

</android.support.v4.widget.DrawerLayout>

关于java - DrawerLayout - 文档中根元素后面的标记必须格式正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20384862/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com