Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个按钮图像,如果从界面生成器调用它会正确设置。但是当从代码图像设置时,视网膜显示无法正确显示。我是否必须在代码中明确指定 2x 图像。
如果您有两个 PNG 图像,可以说
CoolImage.png
和
CoolImage@2x.png
那么您只需调用以下命令:
[UIImage imageNamed:@"CoolImage"]
一切都会如您所愿。