About scrolling the view

Discussion in 'iOS Programming' started by iphonejudy, Dec 4, 2008.

  1. macrumors 6502

    iphonejudy

    Joined:
    Sep 12, 2008
    #1
    Hi,

    I use the below code for scrolling the view

    -(void)textFieldDidBeginEditing:(UITextField *)textField {
    if( textField == textfield ) {
    CGRect rc = [textField bounds];
    UIScrollView* v = (UIScrollView*) self.view ;
    rc = [textField convertRect:rc toView:v];
    CGPoint pt = rc.origin ;
    pt.x = 0 ;
    pt.y=40;
    [v setContentOffset:pt animated:YES];
    [textfield becomeFirstResponder];
    }

    it scroll the page up,

    1)I want to scroll down after enter the text in the text box.

    Can anybody please tell me the code for scrolling down?
    Regards
    judy
     
  2. macrumors 6502a

    Joined:
    Oct 24, 2008
    Location:
    Cambridge
    #2

Share This Page