我有一個數組,其中包含20個圖像使用滾動視圖將圖像添加到imageview。所有圖像滾動。Integrate Carousel For ImageView
我想爲我所有的20張圖片添加旋轉木馬圈效果我該怎麼做?我已經試過這個但不行。
將iCarousel.h,iCarousel.m添加到定義委託的包中。
<iCarouselDataSource,iCarouselDelegate,UIScrollViewDelegate>
-(void)viewDidLoad
{
iCarousel *icrusal = [[iCarousel alloc]initWithFrame:CGRectMake(0,0, 320, 480)];
icrusal.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
icrusal.delegate = self;
icrusal.dataSource = self;
icrusal.type=iCarouselTypeRotary;
icrusal.type=iCarouselTypeCoverFlow;
[self.view addSubview:icrusal];
}
-(NSUInteger)numberOfItemsInCarousel:(iCarousel *)carousel
{
return 20;
}
-(UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index
{
//ImgView=[[UIImageView alloc]init];
ImgView=[[UIImageView alloc]init];
return ImgView;
}
- (BOOL)carousel:(iCarousel *)carousel shouldSelectItemAtIndex:(NSInteger)index{
return YES;
}
- (CGFloat)carouselItemWidth:(iCarousel *)carousel
{
//usually this should be slightly wider than the item views
return 180;
}
我該怎麼做,這在此先感謝。
此編碼是正確的或缺少某些東西。 – Vasu
我想對我的圖像有圓形效果。意味着20顯示1 2 3 ...圖像之後。 – Vasu