HarmonyOS 鸿蒙Next 请问 OHOS::Rosen::RSAnimation::SetFinishCallback 这个方法具体是在什么时机会被调用?
HarmonyOS 鸿蒙Next 请问 OHOS::Rosen::RSAnimation::SetFinishCallback 这个方法具体是在什么时机会被调用?
经常会有c++崩溃指向这个地方。挠破头了都想不到是什么原因。求教
#00 pc 0000000000085b24 /system/lib64/librender_service_client.z.so(OHOS::Rosen::RSAnimation::SetFinishCallback(std::__h::shared_ptr<OHOS::Rosen::AnimationFinishCallback> const&)+88)(f7fb1149ee3670a4f3ee220bed42d7eb)
#01 pc 0000000000096e60 /system/lib64/librender_service_client.z.so(OHOS::Rosen::RSImplicitAnimator::CloseImplicitAnimation()+1644)(f7fb1149ee3670a4f3ee220bed42d7eb)
#02 pc 000000000013c43c /system/lib64/librender_service_client.z.so(OHOS::Rosen::RSNode::CloseImplicitAnimation()+92)(f7fb1149ee3670a4f3ee220bed42d7eb)
#03 pc 0000000000aee870 /system/lib64/platformsdk/libace_compatible.z.so(OHOS::Ace::AnimationUtils::CloseImplicitAnimation()+52)(8840d85de3ef74b812ca9a6e56b5dcdd)
#04 pc 0000000000b3afd0 /system/lib64/platformsdk/libace_compatible.z.so(OHOS::Ace::NG::RosenRenderContext::TriggerPageTransition(OHOS::Ace::PageTransitionType, std::__h::function<void ()> const&)+2452)(8840d85de3ef74b812ca9a6e56b5dcdd)
#05 pc 00000000016d913c /system/lib64/platformsdk/libace_compatible.z.so(OHOS::Ace::NG::PagePattern::TriggerPageTransition(OHOS::Ace::PageTransitionType, std::__h::function<void ()> const&)+668)(8840d85de3ef74b812ca9a6e56b5dcdd)
#06 pc 00000000016dca28 /system/lib64/platformsdk/libace_compatible.z.so(OHOS::Ace::NG::(anonymous namespace)::FirePageTransition(OHOS::Ace::RefPtr<OHOS::Ace::NG::FrameNode> const&, OHOS::Ace::PageTransitionType)+632)(8840d85de3ef74b812ca9a6e56b5dcdd)
#07 pc 00000000016dc754 /system/lib64/platformsdk/libace_compatible.z.so(OHOS::Ace::NG::StageManager::StartTransition(OHOS::Ace::RefPtr<OHOS::Ace::NG::FrameNode> const&, OHOS::Ace::RefPtr<OHOS::Ace::NG::FrameNode> const&, OHOS::Ace::RouteType)+388)(8840d85de3ef74b812ca9a6e56b5dcdd)
#08 pc 00000000016dfb30 /system/lib64/platformsdk/libace_compatible.z.so(8840d85de3ef74b812ca9a6e56b5dcdd)
#09 pc 0000000000aa0c04 /system/lib64/platformsdk/libace_compatible.z.so(OHOS::Ace::NG::UITaskScheduler::FlushAfterLayoutTask()+96)(8840d85de3ef74b812ca9a6e56b5dcdd)
#10 pc 0000000000aa0b80 /system/lib64/platformsdk/libace_compatible.z.so(OHOS::Ace::NG::UITaskScheduler::FlushTask(bool)+216)(8840d85de3ef74b812ca9a6e56b5dcdd)
#11 pc 0000000000a81064 /system/lib64/platformsdk/libace_compatible.z.so(OHOS::Ace::NG::PipelineContext::FlushUITasks(bool)+288)(8840d85de3ef74b812ca9a6e56b5dcdd)
#12 pc 0000000000a865a8 /system/lib64/platformsdk/libace_compatible.z.so(OHOS::Ace::NG::PipelineContext::AnimateOnSafeAreaUpdate()+52)(8840d85de3ef74b812ca9a6e56b5dcdd)
#13 pc 0000000001d46e00 /system/lib64/platformsdk/libace_compatible.z.so(8840d85de3ef74b812ca9a6e56b5dcdd)
#14 pc 000000000095b190 /system/lib64/platformsdk/libace_compatible.z.so(8840d85de3ef74b812ca9a6e56b5dcdd)
#15 pc 000000000001bdb4 /system/lib64/chipset-pub-sdk/libeventhandler.z.so(OHOS::AppExecFwk::EventHandler::DistributeEvent(std::_h::unique_ptr<OHOS::AppExecFwk::InnerEvent, void ()(OHOS::AppExecFwk::InnerEvent)> const&)+1140)(8bb4fba1467dee44e41d0d0199f1e4d9)
#16 pc 000000000002d6a8 /system/lib64/chipset-pub-sdk/libeventhandler.z.so(OHOS::AppExecFwk::(anonymous namespace)::EventRunnerImpl::ExecuteEventHandler(std::h::unique_ptr<OHOS::AppExecFwk::InnerEvent, void ()(OHOS::AppExecFwk::InnerEvent)>&)+348)(8bb4fba1467dee44e41d0d0199f1e4d9)
#17 pc 000000000002cf64 /system/lib64/chipset-pub-sdk/libeventhandler.z.so(OHOS::AppExecFwk::(anonymous namespace)::EventRunnerImpl::Run()+908)(8bb4fba1467dee44e41d0d0199f1e4d9)
#18 pc 0000000000030308 /system/lib64/chipset-pub-sdk/libeventhandler.z.so(OHOS::AppExecFwk::EventRunner::Run()+528)(8bb4fba1467dee44e41d0d0199f1e4d9)
#19 pc 00000000000aebb4 /system/lib64/platformsdk/libappkit_native.z.so(OHOS::AppExecFwk::MainThread::Start()+400)(86597fa70e3e423d170f27e0911bfbac)
#20 pc 0000000000004e34 /system/lib64/appspawn/appspawn/libappspawn_ace.z.so(RunChildProcessor(AppSpawnContent*, AppSpawnClient*)+568)(dd2ca1f08cb4bfd1411e66a36ca88644)
#21 pc 000000000000b9e4 /system/bin/appspawn(AppSpawnChild+576)(5d854d9cb7b4d6b81bb827491b8f24eb)
#22 pc 00000000000150e8 /system/bin/appspawn(ProcessSpawnReqMsg+2956)(5d854d9cb7b4d6b81bb827491b8f24eb)
#23 pc 0000000000013360 /system/bin/appspawn(OnReceiveRequest+132)(5d854d9cb7b4d6b81bb827491b8f24eb)
#24 pc 0000000000016cd0 /system/lib64/chipset-pub-sdk/libbegetutil.z.so(HandleRecvMsg+344)(5fbff8622072f916b215ff44bfa1595c)
#25 pc 00000000000167a4 /system/lib64/chipset-pub-sdk/libbegetutil.z.so(HandleStreamEvent+192)(5fbff8622072f916b215ff44bfa1595c)
#26 pc 0000000000013e84 /system/lib64/chipset-pub-sdk/libbegetutil.z.so(ProcessEvent+88)(5fbff8622072f916b215ff44bfa1595c)
#27 pc 0000000000013a40 /system/lib64/chipset-pub-sdk/libbegetutil.z.so(RunLoop+308)(5fbff8622072f916b215ff44bfa1595c)
#28 pc 00000000000112d0 /system/bin/appspawn(AppSpawnRun+136)(5d854d9cb7b4d6b81bb827491b8f24eb)
#29 pc 000000000000ec3c /system/bin/appspawn(main+764)(5d854d9cb7b4d6b81bb827491b8f24eb)
#30 pc 00000000000a1038 /system/lib/ld-musl-aarch64.so.1(libc_start_main_stage2+64)(9efec5778ffb3078f1dae5f893026944)
<button style="position: absolute; padding: 4px 8px 0px; cursor: pointer; top: 8px; right: 8px; font-size: 14px;">复制</button>
1 回复
OHOS::Rosen::RSAnimation::SetFinishCallback
方法在鸿蒙操作系统(HarmonyOS)的动画框架中用于设置一个回调,该回调会在动画完成其执行周期时被调用。具体来说,这个回调函数的触发时机通常是在以下情况之一:
-
动画自然结束:当动画按照设定的时长和效果正常播放完毕时,
SetFinishCallback
设置的回调函数会被触发。 -
动画被取消:如果动画在执行过程中被显式取消(例如通过调用某个取消动画的方法),并且系统支持在取消时触发完成回调,那么该回调也会被调用。不过,这一点可能依赖于具体的动画实现和鸿蒙系统的版本。
-
动画循环结束:对于设置为循环播放的动画,如果动画完成了设定的循环次数,且系统设计为在循环结束时触发完成回调,那么此时也会调用该回调。但通常,循环动画的完成回调逻辑可能需要开发者自行处理,以确保在最后一次循环结束时触发。
需要注意的是,具体行为可能因鸿蒙系统的不同版本和动画的具体实现而有所不同。如果问题依旧没法解决请联系官网客服,官网地址是:https://www.itying.com/category-93-b0.html