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

标签 android xml eclipse

我正在 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/

相关文章:

android - 如何知道我的应用程序已从设备上卸载...?

xml - 如何在出现一定的字符串分隔符后获取字符串?

android - 无法运行 com.android.ide.eclipse.adt.internal.build.AidlProcessor

xml - Intellij IDEA 中的 xml 文件中的 "Cannot resolve symbol"

java - Gradle Eclipse WTP 插件

java - 如何在配置 util 字符串中添加 java 变量值 -

java - 如何从使用 ArrayList 创建的 JSONObject 中获取所有值?

android - PhoneGap Android + jQuery 移动应用程序不会向下滚动

android - 我总是得到 0 个 queryBuilder().where(). Between() 结果

xml - 返回 "System.Collections.Generic.List"而不是 XML 或 JSON 中的记录集