【发布时间】:2014-10-23 04:34:43
【问题描述】:
错误在最后一行。而且我不知道在这里做什么或什么代码可以工作。如果有人能告诉我他们为解决这个问题做了什么,我会很高兴。
<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 没有关闭。
-
您使用
@string/错误。如果您想简单地硬编码您的值,那很好,但请删除@string/部分。只有在使用 strings.xml 文件时才会使用它,然后使用指定文本的 ID
标签: java android attributes textview element