我有以下代码。
//Create a view to place repeated arrow in.
UIView *rootView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 60)];
//Add Repeated Arrows to the top of the view using a color pattern.
UIImage *arrowImage = [UIImage imageNamed:@"arrow-down"];
UIColor *repeatedArrowColor = [UIColor colorWithPatternImage:arrowImage];
CGRect repeatedArrowFrame = CGRectMake(0, 0, 320.0, [arrowImage size].height);
UIView *repeatedArrowView = [[UIView alloc] initWithFrame:repeatedArrowFrame];
[repeatedArrowView setBackgroundColor:repeatedArrowColor];
[rootView addSubview:repeatedArrowView];
使用的图像是带有彩色箭头的 png #323232。我通过右键单击 .app 文件并选择显示包内容来验证这一点。
然而,当图案出现在 iOS 模拟器屏幕上时,箭头的颜色是 #262626 或 #252525。
有没有人遇到过这个问题?如果是这样,您是如何解决的,或者您是否解决了它?