Iphone CALayer边界在旋转时变得模糊

Iphone CALayer边界在旋转时变得模糊,iphone,objective-c,ios,Iphone,Objective C,Ios,我正在使用 UIColor*clear=[UIColor blackColor]; [self.color:[color CGColor]] 为图像设置边框。这是在添加边框,但当我尝试将图像旋转到45度、90度等角度时,边框开始变得模糊,不再固定或笔直。无论我做什么,怎么能把边界像线一样固定 UIColor* clear = [UIColor blackColor]; [self.layer setBorderColor:[color CGColor]]; 看起来有点奇怪;\这里的自我是什么?

我正在使用 UIColor*clear=[UIColor blackColor]; [self.color:[color CGColor]]

为图像设置边框。这是在添加边框,但当我尝试将图像旋转到45度、90度等角度时,边框开始变得模糊,不再固定或笔直。无论我做什么,怎么能把边界像线一样固定

UIColor* clear = [UIColor blackColor]; [self.layer setBorderColor:[color CGColor]];
看起来有点奇怪;\这里的自我是什么? 设法


别忘了包括QuartzCore框架和导入,我正在为UIImageView创建自定义类,这就是为什么self。我认为您应该尝试设置self的边框属性,在superview中的某个地方,正如我所写,您可以将图像添加为子视图,只是为了实验,但如果你对像素化感兴趣,请查看@George的链接
UIImageView *imgView = [[UIImageView alloc] setImage:[UIImage imageNamed:@"pic.png"]];
[self.view addSubview:imgView];
imgView.layer.borderWidth = 2.0f;
imgView.layer.borderColor = [[UIColor blackColor] CGColor];