【问题标题】:How to use ImageView in the Design Editor of AndroidStudio?如何在 Android Studio 的设计编辑器中使用 ImageView?
【发布时间】:2015-03-27 01:56:12
【问题描述】:

我正在处理Sunshine App tutorials,我真的坚持在我的用户界面中放置ImageView。我发现的所有内容都在 XML 文件中执行,甚至那些我尝试复制和粘贴的内容都不起作用。

起初我只在 App 文件夹中拥有 ic_launcher。然后在阅读其他解决方案 XML 文件后,我右键单击 main/res/drawable 并做了 New→Image Asset 所以现在所有这些 mipmap- 都包含 ic_launcher.png 并且它仍然在我的 app 中,如您所见:

但现在我不知道该怎么做才能让它真正起作用。我在 SRC 中尝试了一些东西,这似乎是它的去处:

  • @mipmap-hdpi/ic_launcher
  • @drawable/ic_launcher
  • ic_launcher
  • @mipmap/ic_launcher

没有一个有效。

【问题讨论】:

    标签: android android-layout android-studio android-imageview


    【解决方案1】:

    我看到你得到了

    无法将 @drawable/... 转换为可绘制对象

    我不确定这是否可行,但您可以尝试重新启动您的 Android 工作室。

    Android: failed to convert @drawable/picture into a drawable

    【讨论】:

      猜你喜欢
      • 2016-12-24
      • 2019-01-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-25
      • 1970-01-01
      • 2023-03-15
      相关资源
      最近更新 更多