【发布时间】:2011-01-21 02:45:09
【问题描述】:
快速提问,我在UIView 中得到了这个drawRect 方法,带有UILabel 和圆圈。圆圈绘制正确,但UILabel 不正确。
有什么想法吗?
感谢您的帮助。
- (void)drawRect:(CGRect)theRect{
CGRect rect = self.bounds;
//text label
UILabel * pText = [[UILabel alloc] initWithFrame: rect];
pText.text = @"demo";
// Circle
UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:rect];
rect = CGRectInset(rect, 5, 5);
[path appendPath:[UIBezierPath bezierPathWithOvalInRect:rect]];
path.usesEvenOddFillRule = YES;
[self.color set];
[path fill];
}
【问题讨论】:
标签: objective-c ios uiview uilabel