Well the category in the link didn't do much for iOS7 and in the end you'd end up having to create your own scroll bar.
This is using the Getting Started sample app and works very well. I did the vertical scroll bar but it'll be easy enough to switch to horizontal; you'll have to mess around with the calculation formulas a little to get them just right. I made it so that it covered the normal vertical scroll indicator.
// .h - added the UIScrollViewDelegate and SDataGridDelegate
@interface ViewController : UIViewController <SDataGridDataSource, UIScrollViewDelegate, SDataGridDelegate>
// .m - assigned delegate and added initial scroll bar image.
- (void) viewDidLoad
_shinobiDataGrid.delegate = self;
UIImageView *image = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"graphic2.png"]];
image.frame = CGRectMake(755, -10.0, 15.0, 100.0);
image.tag = 999;
// Calculate the y point for the top of the scroll bar. Maybe there's a better way
// to do the calculation but we need to make sure that it scrolls down at a ratio
// relative to the screen and content height.
float header = 120;
float y = scrollView.contentOffset.y - header; // Account for header.
float contentHeight = scrollView.contentSize.height;
float frameHeight = scrollView.frame.size.height;
float ratio = contentHeight / frameHeight;
// Calculation fix. Changed this:
// float scrollBarHeight = (contentHeight - frameHeight - (header * 2)) - ((contentHeight - frameHeight) / ratio) + 60;
// To below but although it works fine with 50 records, with 250, it's a little off
// so the formula still needs tweaking to get it right for any number of records.
float scrollBarHeight = frameHeight - ((contentHeight - frameHeight) / ratio) + header;
NSLog(@"y = %f", y);
NSLog(@"contentHeight = %f : frameHeight = %f", contentHeight, frameHeight);
NSLog(@"ratio = %f : new y = %f", ratio, y/ratio);
NSLog(@"scrollBarHeight = %f", scrollBarHeight);
[self moveScrollBar:y/ratio scrollBarHeight:scrollBarHeight];
- (void)moveScrollBar:(float)y scrollBarHeight:(float)scrollBarHeight
UIImageView *image = (UIImageView *)[_shinobiDataGrid viewWithTag:999];
if (image != nil)
image.frame = CGRectMake(755, y, 15.0, scrollBarHeight);
Again, the values you'll have to tweak for your own and you'll have to change the location and image size for covering the horizontal scroll indicators.