how can i modify contentInset as my animation is going?
I would like to modify my contentInset to the origin of a label that is animating as it is animating ( i'm lowering a label and i would like to scroll the view to the label's origin as it is animating so that it looks like it is stayi开发者_StackOverflow中文版ng still )
You can add both animations in one block like this:
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:<#duration#>];
[<#yourLabel#> setFrame:CGRectMake(<#CGFloat x#>, <#CGFloat y#>, <#CGFloat width#>, <#CGFloat height#>)];
[<#yourScrollView#> setContentInset:UIEdgeInsetsMake(<#CGFloat top#>, <#CGFloat left#>, <#CGFloat bottom#>, <#CGFloat right#>)];
[UIView commitAnimations];
Let me know if this works for you.
精彩评论