Search code examples
iphoneiosanimationviewuiactionsheet

View animation frame change


Are emerging in the subview scrolling animation. However actionsheet place when you scroll subview, not again appear in the first place.

 if(checkboxState == 0)
{
    NSTimeInterval animationDuration = 0.8;
    CGRect newFrameSize = CGRectMake(0, 155,320,120);
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:animationDuration];
    subview.frame = newFrameSize;
    [UIView commitAnimations];
}
else if(checkboxState == 1)
{
    NSTimeInterval animationDuration = 0.8;
    CGRect newFrameSize = CGRectMake(0, 105,320,120);
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:animationDuration];
    subview.frame = newFrameSize;
    [UIView commitAnimations];
  }

Pressing the View is a checkbox in the above code is provided to move up and down. However, even though actionsheet slipped up again when the first view is in place.

View is scrolled up, how can we keep it that way, even if opened actionsheet?


Solution

  • I fixed the problem by using the subview.bounds Thank you for your helps.