我正在使用RubyMotion创建OS x应用程序。我想添加一个应用程序图标。我复制了我的 stopwatch.png 文件到资源目录,并在 Rakefile:

# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project/template/osx'

begin
  require 'bundler'
  Bundler.require
rescue LoadError
end

Motion::Project::App.setup do |app|
  app.name = 'Timetracker'
  app.icon = 'stopwatch.png'
end

当我跑 rake 它不适用我的图标。我甚至跑 rake build.app 创建不使用我的图标。我做错了什么?

有帮助吗?

解决方案

你不能指定它需要在一个格式的直接图像 .icns 档案。

资料来源: https://groups.google.com/forum/#!主题/rubymotion/TxkA9IjRRM4

在此转换: http://iconverticons.com/online/

您可能需要运行 rake clean 让您的图标更改生效。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top