我正在创建 Harmony 应用程序。
在这里,我创建一个通用对话框并设置自定义组件,并使用 component.createAnimatorProperty()
创建动画器属性并启动它。
当我开始动画时,只有组件具有特定属性的动画,但对话框(对话框窗口)不会根据内部组件更改大小来更改其大小。
如何根据内部组件大小动态更改其大小。
// created a custom component for setting it
CommonDialog commonDialog = new CommonDialog(getContext);
commonDialog.setContentCustomComponent(customComponent);
commonDialog.show();
Thread.sleep(1000);
AnimatorProperty animatorProperty = customComponent.createAnimatorProperty().setDuration(100)
.scaleX(1.04f).scaleY(1.04f).scaleXFrom(1).scaleYFrom(1);
animatorProperty.start();
最佳答案
根据当前的 HMOS 平台支持,动画只能设置为对话框中设置的 customComponent 或 titleComponent 对象。换句话说,可以仅对组件对象设置动画。设置对话框的动画,以查看对话框边界动画 - 目前不支持此操作。让我们继续关注 future HMOS 的相关更新。
关于java - 如何在 Harmony 应用程序开发中动态更改对话框中设置的动画组件的大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68595016/