Animate scrolling of UIScrollView with CoreAnimation

后端 未结 4 589
醉酒成梦
醉酒成梦 2021-02-07 09:24

Sorry for a big question, real question are bold in bottom, now some explanation.

I\'m use CoreAnimation in my project for animate some objects moving l

4条回答
  •  没有蜡笔的小新
    2021-02-07 10:15

    [UIScrollViewNameHere setContentOffset:CGPointMake(x value of where you want to move to, y value of where you want to move to) animated:YES];
    

    for example:

    UIScrollView *scroll = [[UIScrollView alloc] initWithFrame:CGRectMake(4, 2, 2341, 412)];
    [scroll setContentOffset:CGPointMake(320, 0) animated:YES];
    

提交回复
热议问题