문제

Hi I am using iCarousel in my application, it will have UITableView as subview. When i am trying to swipe or pan to display next or previous item it is not working. I think UITableView's gesture recogonizer disables the iCarousel's gesture recogonizer. There are so many questions like this but i do not see any answer for this. attched is sample imageenter image description here

Please guide me to fix this.

code

  _carousel =[[iCarousel alloc]initWithFrame:self.view.frame];
  _carousel.type = iCarouselTypeLinear;
  _carousel.pagingEnabled = YES;
  _carousel.delegate = self;
  _carousel.dataSource = self;
  [self.view addSubview:_carousel];
도움이 되었습니까?

해결책

It looks like your carousel isn't centered which makes me think that maybe its bounds are wrong.

iCarousel doesn't have clipsToBounds enabled by default, which means that if the bounds are wrong, you will still see your item views, but may not be able to interact with them.

Try enabling clipsToBounds on the carousel, and setting the backgroundColor to something like red, so you can see if the carousel dimensions are correct.

If they aren't you may need to adjust your autoresizing or autolayout constraints.

UPDATE:

This was actually a bug in iCarousel relating to the heuristic it uses to determine if swipe gestures should be intercepted by the carousel. Fixed in beta 7.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top