CADisplayLink stops updating when UIScrollView scrolled

后端 未结 8 1455
星月不相逢
星月不相逢 2020-12-05 15:17

Title is quite self explanatory, but I have some animation being done in a loop triggered by CADisplayLink. However, as soon as I scroll a UIScrollView I have added to my vi

8条回答
  •  北荒
    北荒 (楼主)
    2020-12-05 15:31

    We fixed this same issue by changing the frameInterval from 1, to 2. This essentially halves the rendering rate of your OpenGL scene, but it still may render sufficiently for your needs.

    frameInterval The number of frames that must pass before the display link notifies the target again.

    @property(nonatomic) NSInteger frameInterval Discussion The default value is 1, which results in your application being notified at the refresh rate of the display. If the value is set to a value larger than 1, the display link notifies your application at a fraction of the native refresh rate. For example, setting the interval to 2 causes the display link to fire every other frame, providing half the frame rate.

    Setting this value to less than 1 results in undefined behavior and is a programmer error.

提交回复
热议问题