我是一名有用的助手,可以为您翻译文本。
我正在开发一个Android Wear应用程序,并尝试在图像上覆盖文本。在main_activity.xml中,我有以下内容:
我该在哪里添加图片
我正在开发一个Android Wear应用程序,并尝试在图像上覆盖文本。在main_activity.xml中,我有以下内容:
<ImageView
android:id="@+id/myImageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher1.png" />
<TextView
android:id="@+id/myImageViewText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@id/myImageView"
android:layout_alignTop="@id/myImageView"
android:layout_alignRight="@id/myImageView"
android:layout_alignBottom="@id/myImageView"
android:layout_margin="1dp"
android:gravity="center"
android:text="Hello"
android:textColor="#000000" />
Android Studio 报错 cannot resolve symbol @drawable/ic_launcher1.png
要修复此问题,我在 values
文件夹中创建了 refs.xml
文件
refs.xml
内容:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<drawable name="ic_launcher1.png">test</drawable>
</resources>
我该在哪里添加图片
ic_launcher1.png
?