我在尝试解决指定错误时遇到问题。
这是我的 activity_craft_your_story.xml
布局的 xml 代码:
<ImageView
android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:contentDescription="@string/titleGraphic"
android:src="@drawable/black_title" />
这是我当前尝试将该文件与 CraftYourStoryActivity.java
链接的代码:
public void BitmapDrawable (Resources res, Bitmap bitmap, Object BitmapDrawable)
{
ImageView titleGraphic = (ImageView) findViewById(R.id.image);
titleGraphic.getResources().getDrawable(R.drawable.black_title);
}
我不知道这是否适合使用,但我需要一个工作标题图形。我能做什么?
最佳答案
请检查drawable文件夹。 确保它包含 black_title.png 图像并且其名称正确。
android:src="@drawable/black_title"会给你错误,直到它没有得到/res/drawable/black_title.png
关于java - 错误: No resource found that matches the given name (at 'src' with value '@drawable/black_title' ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24653869/