I implemented a horizontal UIScrollView inside a custom UITableViewCell. It works fine when built on ios 8.1 simulator/device. But the content doesn't scroll in ios 7.1 simulator. I had googled about this for a while. Unfortunately nothing helps.
My situation is just like this one. : Horizontal UIScrollView inside custom UITableViewCell - using IB Storyboard - Not scrolling
But the given solution doesn't work with mine..
I have a subclassed UITableViewCell CTCurrentListingCell
@interface CTCurrentListingsCell ()<UIScrollViewDelegate>
@property (strong, nonatomic) IBOutlet UIScrollView *scrollView;
@end
@implementation CTCurrentListingsCell
-(void)layoutSubviews
{
[super layoutSubviews];
[_scrollView setScrollEnabled:YES];
[_scrollView setDelaysContentTouches:YES];
[_scrollView setCanCancelContentTouches:NO];
[_scrollView setDelegate:self];
[_scrollView setContentSize:CGSizeMake(520, 91)];
}
-(void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset
{
NSLog(@" scroll offset %@ ",NSStringFromCGPoint( scrollView.contentOffset));
if(targetContentOffset->x!=320)
{
[_scrollView scrollRectToVisible:CGRectMake(200, 0, 320, 91) animated:YES];
}
}
@end