【问题标题】:ImageView inside LinearLayout not workingLinearLayout 中的 ImageView 不起作用
【发布时间】:2014-01-04 04:39:35
【问题描述】:

我有以下布局,每次我尝试在 Graphical Layout 中查看它时,它都会给出下面的错误消息。

<?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" >

    <ImageView
        android:id="@+id/image"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:src="@drawable/my_greeting" />

</LinearLayout>

错误

找不到以下类: - ImageView(更改为 android.widget.ImageView,修复构建路径,编辑 XML)

【问题讨论】:

    标签: android android-layout android-imageview


    【解决方案1】:

    关闭该文件并重新打开它。如果不能解决问题,只需清理并重建项目。

    【讨论】:

    • 感谢您的帮助。 +1。
    【解决方案2】:

    这与您的图像源my_greeting 有关系。检查源名称是否正确,并检查您是否提供了有效的扩展名。另外,尝试清理项目。

    【讨论】:

      猜你喜欢
      • 2023-03-25
      • 1970-01-01
      • 1970-01-01
      • 2016-10-20
      • 2018-04-23
      • 1970-01-01
      • 1970-01-01
      • 2019-01-03
      • 1970-01-01
      相关资源
      最近更新 更多