Integrating iCarousel with an application with an input panel controller in iOS 6.1

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

+6
source share
1 answer

I notice that your view of the carousel is much smaller than the size of the objects inside it (it's just 125 points).

iCarousel can draw outside its borders, but cannot detect touch events outside its borders, so there may be a problem with scrolling.

A good way to debug this is to set carousel.clipsToBounds = YES, so that what he paints will match what you can feel. Another option is to set carousel.backgroundColor so you can see how much of it is touchable on the screen.

Another thing to check is that the view you placed inside the carousel has userInteractionEnabled set to YES.

+2
source

All Articles