gpt4 book ai didi

android - Java Eclipse android-XML 编辑器(图形显示)不工作

转载 作者:太空宇宙 更新时间:2023-11-03 13:30:37 27 4
gpt4 key购买 nike

我正在 Java Eclipse 上为 Android 开发一些应用程序。至于现在一切正常,但今天突然布局图形显示停止工作,无论我尝试创建新布局还是尝试打开现有布局。它显示没有 XML 内容。请向您的文档添加 Root View 或布局。 错误。我试着关注 android sdk main.out.xml parsing error?说明,但我没有 XSL 选项Eclipse -> 窗口 -> 首选项 -> 运行/调试 -> 启动 -> 启动配置 -> 过滤已检查的启动配置类型。我也没有任何 .out.xml 文件。

这是我的 XML 和 list 文件。

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/hello_world"
tools:context=".FirstScreenActivity" />

</RelativeLayout>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="s.manipulator"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="15" />

<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".FirstScreenActivity"
android:label="@string/title_activity_first_screen" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="android.app.LauncherActivity" />
</activity>
<activity
android:name=".MainMenuActivity"
android:label="@string/title_activity_main_menu" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="s.manipulator.FirstScreenActivity" />
</activity>
</application>

</manifest>

最佳答案

简单修复:

右键单击布局文件 -> 打开方式 -> Android 布局编辑器

在 Eclipse 中,转到 Window -> Preferences -> General -> Editors -> File Associations 并选择 *.xml,然后在关联编辑器列表中的 Android Layout Editor 条目上按 Default。

关于android - Java Eclipse android-XML 编辑器(图形显示)不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13779144/

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