我将 iCarousel 应用程序与单视图应用程序集成在一起。但是当我添加标签栏控制器并将此 iCarousel 代码放在一个标签栏项目视图控制器中时。但它不起作用(显示项目但不滚动)。这里有什么问题。
我创建了 iCarousel,如下所示:
iCarousel *categorySubView = [[iCarousel alloc]initWithFrame:CGRectMake(0,200, 300, 125)];
categorySubView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
categorySubView.delegate = self;
categorySubView.dataSource = self;
categorySubView.type=iCarouselTypeRotary;
[self.view addSubview:categorySubView];
我正在使用以下委托和数据源方法:
-(NSUInteger)numberOfItemsInCarousel:(iCarousel *)carousel
{
return 5;
}
- (UIView *) carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index reusingView:(UIView *)view{
UIView *sampleView=[[UIView alloc]initWithFrame:CGRectMake(0, 0, 250, 300)];
sampleView.backgroundColor=[UIColor whiteColor];
UILabel *labelis=[[UILabel alloc]initWithFrame:CGRectMake(10, 10, 100, 20)];
labelis.backgroundColor=[UIColor clearColor];
labelis.text=@"8Apr-14Apr";
[sampleView addsubView:labelis];
return sampleView;
}
请给我建议。
提前致谢