Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android正在提供\r>;或\n>;错误_Android - Fatal编程技术网

Android正在提供\r>;或\n>;错误

Android正在提供\r>;或\n>;错误,android,Android,好的,我一直在构建一个登录屏幕,完成后一切正常,我创建了一个activity2.xml,并将代码放入其中,它可以正常工作。它将允许我完美地运行它一次,然后一旦它运行,我就会发现这个错误 在此行找到多个批注: -文本大小应使用“sp”而不是“dp” -行尾不正确:发现回车符(\r)没有相应的换行符(\n) 这听起来可能很奇怪,但它对我来说什么都管用。。将所有XML复制到记事本文件并复制回XML文件这将解决找到的回车符(\r)而不会出现相应的换行符(\n)错误 关于注释,它们只是我的建议,最好这样做

好的,我一直在构建一个登录屏幕,完成后一切正常,我创建了一个activity2.xml,并将代码放入其中,它可以正常工作。它将允许我完美地运行它一次,然后一旦它运行,我就会发现这个错误

在此行找到多个批注: -文本大小应使用“sp”而不是“dp” -行尾不正确:发现回车符(\r)没有相应的换行符(\n)


这听起来可能很奇怪,但它对我来说什么都管用。。将所有XML复制到记事本文件并复制回XML文件这将解决找到的回车符(\r)而不会出现相应的换行符(\n)错误


关于注释,它们只是我的建议,最好这样做。

我也遇到过类似这样的奇怪问题。对于我来说,总是可以通过删除错误所在行中的所有空白,然后再将其添加回来解决问题。

这很奇怪,是不是这样做了?要我给你看一个屏幕截图吗?我不确定它是安卓系统,但更多的是Eclipse。。你试着去更新它,你的想法奏效了,兄弟,一点问题都没有,哇..我还有一个问题要问你,如果我删除imageview部分,它会删除图像吗?首先,请将其标记为答案;其次,如果你删除imageview代码,你的UI中将有任何图像,最后一个Textview将取代imageview。我如何将你的答案标记为正确,你能告诉我ntoepad是如何修复的吗?哈哈,这是一件很棒的事情,但我不敢相信它仍然能修复。很高兴我不是唯一一个,希望这能帮助其他人。我以为我疯了哈哈
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#f9fa9b"
android:orientation="vertical" >

<ScrollView
    android:id="@+id/scrollView1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <LinearLayout
        android:id="@+id/linearLayout2"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >

        <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:text="Activity 2"
            android:textColor="#FF00FF"
            android:textSize="30dp" />


        <Button
            android:id="@+id/button1"
            android:layout_width="66dp"
            android:layout_height="38dp"
            android:layout_marginTop="10dp"
            android:background="#00FF00"
            android:text="Button 1" />


        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="195dp"
            android:layout_height="169dp"
            android:layout_gravity="center_horizontal"
            android:src="@drawable/ic_launcher" />


        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:layout_marginTop="150dp"
            android:text="activity2.xml"
            android:textColor="#FF00FF"
            android:textSize="30dp" />

    </LinearLayout>
 </ScrollView>