Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/344.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
Java “元素类型”;textview";必须后跟属性规范中的任何一个&燃气轮机&引用;或/&燃气轮机&引用;_Java_Android_Attributes_Textview_Element - Fatal编程技术网

Java “元素类型”;textview";必须后跟属性规范中的任何一个&燃气轮机&引用;或/&燃气轮机&引用;

Java “元素类型”;textview";必须后跟属性规范中的任何一个&燃气轮机&引用;或/&燃气轮机&引用;,java,android,attributes,textview,element,Java,Android,Attributes,Textview,Element,错误在最后一行。我不知道在这里做什么,也不知道什么代码可以工作。如果有人能告诉我他们做了什么来解决这个问题,我会很高兴的 <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

错误在最后一行。我不知道在这里做什么,也不知道什么代码可以工作。如果有人能告诉我他们做了什么来解决这个问题,我会很高兴的

<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"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.jokeoftheday.MainActivity" >

<TextView
    android:id="@+id/textView2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="90dp"
    android:text="@string/Your joke of the day is:"
    android:textSize="18sp" />

<TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@+id/textView2"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="61dp"
    android:text="@string/The problem with twitter is that you always run out of chara-" >
</TextView>


只需将上一个文本视图的内容与文本视图中的内容进行比较即可

看看以前你是怎么没钱的?您只是在所有属性的末尾添加了/>。您需要将最后一块更改为:

<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView2"
android:layout_centerHorizontal="true"
android:layout_marginTop="61dp"
android:text="@string/The problem with twitter is that you always run out of chara-" />

这是一个很容易解决的问题

希望有帮助。祝你好运:)两个问题

  • 文本id不应包含“空格”,因此“问题…”
  • 这是主要的问题,你错过了这次会议的“结束”
  • 注:


    TextView的两个“结束”都是合法且有效的。

    您的第二个TextView未关闭。您使用的
    @string/
    错误。如果您只想硬编码您的值,那很好,但是删除
    @string/
    部分。只有在使用strings.xml文件,然后使用指定文本的ID时,才能使用该文件