我尝试使用以下代码绘制自定义视图,但由于某种原因边框呈现错误,顶部有小间隙。
self.infoContainerView = [[UIView alloc] initWithFrame:CGRectMake(12, (self.contentImage.image.size.height/self.contentImage.image.size.width)*320.0-50), self.view.frame.size.width - 24, self.view.frame.size.height - self.contentImage.frame.size.height - 24)];
self.infoContainerView.backgroundColor = [UIColor whiteColor];
self.infoContainerView.layer.borderWidth = 0.5f;
self.infoContainerView.layer.borderColor = [[[UIColor blackColor] colorWithAlphaComponent:0.15f] CGColor];
这就是结果:
答案 0 :(得分:0)
尝试给出像
这样的边框颜色self.infoContainerView.layer.borderColor = [[UIColor blackColor] CGColor];