我正在创建 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();