【发布时间】:2018-12-17 08:30:52
【问题描述】:
我已在可绘制对象中粘贴了一个图像文件,但它没有显示在 XML 文件中。
在下面的代码中,“src”之后的部分得到红色高亮显示,即使我在 Drawable 中有相同的命名文件。
这是 XML 代码:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Splash">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/splashImage"
android:src="@drawable/splash"
【问题讨论】:
-
ImageView上没有src属性。 -
将此添加到图像视图 android:src="@drawable/ic_launcher" 并查看
标签: android xml image imageview