I want to display an image using icarousel however I don't know the image size so that it won't show it squeezed up or something like that. I want to crop it so that it will fit perfectly. Does anyone know the image size?
问问题
1014 次
1 回答
1
you can set view size here,
- (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index
{
UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"%@",[menuViews objectAtIndex:index]]];
UIView* _reflectionView =[[[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, image.size.width, image.size.height)] autorelease];
UIImageView *imgview = [[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, image.size.width, image.size.height)] autorelease];
imgview.image = image;
[_reflectionView addSubview:imgview];
return _reflectionView;
}
于 2013-07-17T09:26:17.530 回答