【问题标题】:Android Studio for Mac: Use original colour image for splash screenAndroid Studio for Mac:使用原始彩色图像作为初始屏幕
【发布时间】:2020-01-08 01:13:18
【问题描述】:

我有一张多色图像,希望在启动画面上使用。我正在使用指南from here,它需要在AppTheme.Launcherstyle 下指定图像,并使用itemandroid:windowBackground 通过@Drawable/SplashIcon 指定图像名称

我被困在如何将图像实际添加到项目中。到目前为止,我一直在使用菜单操作 new -> Image Asset 添加图像,它会使颜色变平,并且似乎没有按原样导入的选项。

我已通过拖放到 Android Studio 中的 drawable 文件夹中来添加图像,但我无法使用 Drawable/SplashIcon 引用它。

这是我所拥有的:

如何引用我的图片?

【问题讨论】:

    标签: android android-studio splash-screen android-image


    【解决方案1】:

    好像是文件名的问题。文件名必须使用小写字母和下划线,仅此而已。

    因此,我拖放了名为 splash_icon.png 的图像,现在它出现在 @drawable/...

    我现在也按照建议使用不同的像素密度。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-02-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多