I integrate the iCarousel application with a single view. But when I add the controller of the tab bar and place this iCarousel code in one control bar of the Item Item, but it doesnβt work (the elements are displayed but not scrolled). What is the problem here.
I created iCarousel as shown below:
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];
I use the following delegate and data source methods:
-(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; }
Please suggest me.
Thanks inadvance
source share