keypad hides text view
<p>i am placing a tableview,textview,buttons in a view as <a href="http://www.freeimagehosting.net/uploads/1f91e8626a.png" rel="nofollow">like this</a>.</p>

<p>when ever i click on the textview keypad hides textview.To animate up textview i am writing the code as fallows.</p>

<pre><code>- (void) textViewDidBeginEditing:(UITextView *)textView {
    [self animateTextField:textView up:YES];
}

- (void) textViewDidEndEditing:(UITextView *)textView {
    [self animateTextField:textView up:NO];
}

- (void) animateTextField: (UITextView*) textView up: (BOOL) up {
    const int movementDistance = 80; // tweak as needed
    const float movementDuration = 0.3f; // tweak as needed

    int movement = (up ? -movementDistance : movementDistance);

    [UIView beginAnimations: @"anim" context: nil];
    [UIView setAnimationBeginsFromCurrentState: YES];
    [UIView setAnimationDuration: movementDuration];
    self.view.frame = CGRectOffset(self.view.frame, 0, movement);
    [UIView commitAnimations];
}
</code></pre>

<p>But it does n't take any effect.</p>

<p>And To hide the keypad i am writing this code</p>

<pre><code>-(void) touchesBegan :(NSSet *) touches withEvent:(UIEvent *)event {
    [mytextview resignFirstResponder];
}
</code></pre>

<p>it is also does n't take any effect.</p>

<p>can any one please help me.</p>

<p>Thank u in advance.</p>
