Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios icarousel图像的大小是多少_Ios_Image_Icarousel - Fatal编程技术网

Ios icarousel图像的大小是多少

Ios icarousel图像的大小是多少,ios,image,icarousel,Ios,Image,Icarousel,我想用icarousel显示一个图像,但是我不知道图像的大小,这样它就不会显示被挤压的图像或者类似的东西。我想把它裁剪一下,这样它会非常合身。有人知道图像的大小吗 您可以在此处设置视图大小 - (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index { UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:

我想用icarousel显示一个图像,但是我不知道图像的大小,这样它就不会显示被挤压的图像或者类似的东西。我想把它裁剪一下,这样它会非常合身。有人知道图像的大小吗

您可以在此处设置视图大小

- (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;
}

您可以根据需要更改图像的大小。