gpt4 book ai didi

iphone - UIImageView 边框颜色

转载 作者:可可西里 更新时间:2023-11-01 03:35:59 25 4
gpt4 key购买 nike

我有以下代码:

UIColor *borderColor = [UIColor colorWithRed:182 green:10 blue:96 alpha:1.0];
[viewImage.layer setBorderColor:borderColor.CGColor];
[viewImage.layer setBorderWidth:3.0];
[productView addSubview:viewImage];

viewImage 是我的 UIImageViewproductView 是我的 UIView

我想要这个颜色enter image description here ,但我得到的只是这种颜色 enter image description here .我尝试了不同的值,我得到的所有颜色都是白色、红色、黑色、黄色或蓝色。我无法获得任何其他颜色,无论我输入什么值。我尝试了 colorWithHue:Saturation:Brightness,我遇到了同样的问题。

我在 iOS 6 SDK 上使用它。

我做错了什么,我该如何解决?

最佳答案

#import <QuartzCore/QuartzCore.h>

[imageView.layer setBorderColor: [[UIColor blackColor] CGColor]];
[imageView.layer setBorderWidth: 2.0];

关于iphone - UIImageView 边框颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13079612/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com