android - Android中的代码错误

标签 android compiler-errors

所以这是我的代码之一,每当我单击运行时,由于此代码中的错误,我的项目都无法构建

android:id="@+id/list_item_forecast_textview" />

对于此代码,它表示文件意外结束,在代码中的>旁,代码中的>旁有一条红色的小字形线。我应该如何解决小代码错误?

最佳答案

@Simran:
我认为您缺少像<这样的开头标签。请添加此。

 <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:orientation="vertical" >
    <TextView android:id="@+id/list_item_forecast_textview"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="Hello,I am a TextView" />

</LinearLayout>

我认为您是Android的新手,因此在开始之前,请阅读xml Write the XML的正式文档

关于android - Android中的代码错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32236956/

相关文章:

c - 在大型项目上运行 Clang-Tidy

c++ - 作为仿函数模板的模板参数

c# - 编译器错误: Unexpected symbol '}'

android - 抽屉导航 : How do I set the selected item at startup?

android - 按下切换按钮 3 次后,闪光灯 Android 应用程序崩溃,并且 LED 永远不会亮起

java - 如何快速制作我的 Android 应用程序

ios - Flutter - 代码签名错误 : No profiles for 'com.xxx.yourApp' were found

Java - 解析 JSON 响应 - 内容是 String 或 JSONObject

android - Color_FormatSurface 实现

c++ - 不知道出了什么问题(字符串输入)