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.
是否可以直接在界面生成器上使用添加到资产目录的图像?这是怎么做的?
在 UIImageView 属性上,我看不到任何选项来引用资产目录上的任何图像。
.xcassets
然后可以使用UIImage *image = [UIImage imageNamed:@"some-image"]或通过 IB/Storyboards 中的图像下拉菜单以编程方式引用图像。
UIImage *image = [UIImage imageNamed:@"some-image"]
资产目录中的所有图像都有一个名称。这个名称可以imageNamed:在 IB 中使用。
imageNamed: