UIScrollViewDelegate 不滚动动画

发布于 2025-01-02 03:44:04 字数 396 浏览 5 评论 0原文

我创建了一个使用 UIScrollViewDelegate 的 UIScrollView 子类。我创建它是为了与 OpenGL ES 对象一起使用。我有以下代码:

-(void)scrollViewDidScroll:(UIScrollView *)scrollView{
    for(InputEntity * iEnt in [sceneInstance inputObjects]){
        iEnt.display.translation = GLKVector2Make(0, self.contentOffset.y);
    }
}

它最终将所有内容放在正确的位置,但直到滚动视图停止移动后才会更新位置。有没有办法解决这个问题,使其看起来像 UIScrollViews 一样动画?

I have created a subclass of UIScrollView that uses the UIScrollViewDelegate. I created it to work with OpenGL ES objects. I have the following code:

-(void)scrollViewDidScroll:(UIScrollView *)scrollView{
    for(InputEntity * iEnt in [sceneInstance inputObjects]){
        iEnt.display.translation = GLKVector2Make(0, self.contentOffset.y);
    }
}

It eventually puts all the content in the correct spot, but it does not update the locations until after the scroll view has stopped moving. Is there a way to fix this so it looks animated like UIScrollViews do?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

眼泪淡了忧伤 2025-01-09 03:44:04

你有像 setNeedDisplay: 这样的渲染方法吗?
如果你有,你可以:

-(void)scrollViewDidScroll:(UIScrollView *)scrollView{
for(InputEntity * iEnt in [sceneInstance inputObjects]){
    iEnt.display.translation = GLKVector2Make(0, self.contentOffset.y);
    //render here
}
}

do you have render method like setNeedDisplay:
if you have,you can:

-(void)scrollViewDidScroll:(UIScrollView *)scrollView{
for(InputEntity * iEnt in [sceneInstance inputObjects]){
    iEnt.display.translation = GLKVector2Make(0, self.contentOffset.y);
    //render here
}
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文