Pripyat
Pripyat

Reputation: 2937

UIImageView Border Problem

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?

Upvotes: 2

Views: 7161

Answers (1)

EmptyStack
EmptyStack

Reputation: 51374

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.

Upvotes: 2

Related Questions