Почему UIImageView не вращается вокруг?Почему UIImageView не вращается?
Мне нужно отображать сегменты вокруг центральной рамки, но она не вращается.
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
_baseImage = [UIImage imageNamed:@"setAlarmSegment.png"];
_segmentCircleArray = [[NSMutableArray alloc] initWithCapacity:16];
for (int i=0; i<16; i++) {
UIImageView *imageViewSegment = [[UIImageView alloc] initWithImage:_baseImage];
[imageViewSegment setFrame:self.frame];
imageViewSegment.transform = CGAffineTransformMakeRotation((M_PI*2/16.0f)*i);
[_segmentCircleArray addObject:imageViewSegment];
}
self.backgroundColor = [UIColor colorWithWhite:0 alpha:0];
}
return self;
}
- (void)drawRect:(CGRect)rect
{
for (UIImageView *segment in _segmentCircleArray) {
[segment drawRect: rect];
}
}
спасибо.
Спасибо большое! Теперь читаем ссылку. – setixela