开发者

UIImageView Border Problem

开发者 https://www.devze.com 2023-02-01 03:33 出处:网络
I\'m adding a border to a UIImageView subclass of mine which works great: self.layer.borderColor = [UIColor开发者_如何转开发 whiteColor].CGColor;

I'm adding a border to a UIImageView subclass of mine which works great:

self.layer.borderColor = [UIColor开发者_如何转开发 whiteColor].CGColor;

self.layer.borderWidth = 10;

Upon adding a UIImageView to the top of the image however, I noticed that the border is covering the image up!

UIImage*pin = [UIImage imageNamed:@"PinDown2"];

UIImageView*view = [[UIImageView alloc] initWithImage:pin];

view.frame = CGRectMake(self.bounds.size.width/2, 0, 32, 39);

[self addSubview:view];

How can I fix this?


If you don't find any alternative, try this,

Link 1

or this,

Link 2

Both are from same post. You can also find other answers there.

0

精彩评论

暂无评论...
验证码 换一张
取 消