0

I am using UIColor* clear = [UIColor blackColor]; [self.layer setBorderColor:[color CGColor]];

to set the border for an image.It is adding border but when i tried rotating that image to 45 degree,90 degree so on ,that border starts getting fuzzy and its not fixed or straight anymore. How can image that border fix like a line always whatever i do..

user1226038
  • 77
  • 1
  • 9

1 Answers1

0
UIColor* clear = [UIColor blackColor]; [self.layer setBorderColor:[color CGColor]];

looks like something weird ;\ what is self here? try to

UIImageView *imgView = [[UIImageView alloc] setImage:[UIImage imageNamed:@"pic.png"]];
[self.view addSubview:imgView];
imgView.layer.borderWidth = 2.0f;
imgView.layer.borderColor = [[UIColor blackColor] CGColor];

And don't forget to include QuartzCore framework and #import <QuartzCore/QuartzCore.h>

Aft3rmath
  • 669
  • 2
  • 12
  • 21