Creating a custom UIScrollView Scroller

Okay, I have been all over the internet trying to find the answer to this, I am trying to create a custom UIScrollView scroller.

Here is a link to a picture of the scroller

http://postimage.org/image/cg2jvde9z/

http://postimage.org/image/ko0mp3kdj/ (that white box is just for me to test the scrollview)

I have gotten the scroller to work, although I need help figuring out how many pixels the scrollview should move every time the scroller is pushed

here is some code

-(IBAction)scroller_bar:(id)sender withEvent:(UIEvent *)event{    
UIButton *button_sent = (UIButton *)sender;

UITouch *touch = [[event touchesForView:button_sent] anyObject];

CGPoint previousLocation = [touch previousLocationInView:button_sent];
CGPoint location = [touch locationInView:button_sent];
CGFloat delta_x = location.x - previousLocation.x;
float left_side = button_sent.center.x + delta_x;
float right_side = button_sent.center.x + delta_x;
if (right_side > button_sent.center.x) {
    scroll_right = YES;
}
else{
    scroll_right = NO;
}
if (left_side <= 13 + 50.5 || right_side >= 307 - 50.5) {

}
else{
    button_sent.center = CGPointMake(button_sent.center.x + delta_x,
                                     button_sent.center.y);

    if (scroll_right) {

    [selection_scroll setContentOffset:CGPointMake(selection_scroll.contentOffset.x - (Help HERE!), selection_scroll.contentOffset.y) animated:YES];
    }
    else{

        [selection_scroll setContentOffset:CGPointMake(selection_scroll.contentOffset.x + (Help HERE!), selection_scroll.contentOffset.y) animated:YES];


    }
}

}

In the above code you should see a '(Help HERE!)',

that is where i am trying to figure out how many pixels i should move the scroll view. This is a bit of a confusing question, hope you understand.

Thanks :)

Answers


I don't know whether APPLE will approve this or not but the code written below can change the scollView 's scroller images

for (UIImageView *img in yourscrollView.subviews) { 
    [img setImage:[UIImage imageNamed:@"your custom scroller image"]];
}

Need Your Help

Is there a tool to generate XML picklers in Haskell from an XSD?

haskell xsd code-generation

I'd like to generate XML picklers for an XSD file. It seems like a useful tool that might already exist. Does it?

Change bootstrap popover background color

javascript jquery html css twitter-bootstrap

I am trying to change the CSS on a bootstrap popover. I want to change the entire popover background, not just the text.