【发布时间】:2023-03-29 10:57:01
【问题描述】:
我在 xcode 图像资源中添加了一个 PDF 矢量文件。矢量文件有颜色和设计。但是,在模拟器上生成的时候,形状保留了,但是颜色和设计都没有了,换成了纯色。
// code to add the button
- (void) addReplyButton:(STRContent *)content {
UIButton *replyBtn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
replyBtn.frame = CGRectMake(0, 0, 0, 0);
[[replyBtn imageView] setContentMode: UIViewContentModeScaleAspectFit];
[replyBtn setImage:[UIImage imageNamed:@"reply_button"] forState:UIControlStateNormal];
[self.photoView addSubview:replyBtn];
}
原图
输出
【问题讨论】:
-
每次都会发生吗?或者有时显示正确的图像?