From 1ae2ce8d927423818c55391c589efb2be590db6a Mon Sep 17 00:00:00 2001 From: zgf Date: Fri, 15 Nov 2024 15:37:10 +0800 Subject: [PATCH] =?UTF-8?q?ImageKnifeAnimatorComponent=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E5=9C=86=E8=A7=92=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zgf --- CHANGELOG.md | 1 + README_zh.md | 3 +-- entry/src/main/ets/pages/ImageAnimatorPage.ets | 3 ++- .../src/main/ets/components/ImageKnifeAnimatorComponent.ets | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 025c59a..5584501 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Fix inability to parse Resource format images of other modules - Improve the error logs - Fix callback onLoadFailed when taskpool exception occurs +- ImageKnife AnimatorComponent component adds rounded corner function ## 3.2.0-rc.2 - Added callback information for image loading diff --git a/README_zh.md b/README_zh.md index 9e65f65..95daf70 100644 --- a/README_zh.md +++ b/README_zh.md @@ -467,5 +467,4 @@ DevEco Studio: NEXT Beta1-5.0.3.806, SDK: API12 Release(5.0.0.66) ## 遗留问题 -- ImageKnifeAnimator组件无法设置ImageFit属性 -- ImageKnifeAnimator组件设置border属性无法将图片变为圆角 \ No newline at end of file +- ImageKnifeAnimator组件无法设置ImageFit属性 \ No newline at end of file diff --git a/entry/src/main/ets/pages/ImageAnimatorPage.ets b/entry/src/main/ets/pages/ImageAnimatorPage.ets index 8c923a5..22b413b 100644 --- a/entry/src/main/ets/pages/ImageAnimatorPage.ets +++ b/entry/src/main/ets/pages/ImageAnimatorPage.ets @@ -69,7 +69,8 @@ struct ImageAnimatorPage { imageKnifeOption:{ loadSrc:'https://gd-hbimg.huaban.com/e0a25a7cab0d7c2431978726971d61720732728a315ae-57EskW_fw658', placeholderSrc:$r('app.media.loading'), - errorholderSrc:$r('app.media.failed') + errorholderSrc:$r('app.media.failed'), + border: { radius: 150 } },animatorOption:this.animatorOption }).width(300).height(300).backgroundColor(Color.Orange).margin({top:30}) Text($r('app.string.Display_the_first_frame')).fontSize(20) diff --git a/library/src/main/ets/components/ImageKnifeAnimatorComponent.ets b/library/src/main/ets/components/ImageKnifeAnimatorComponent.ets index 67816a3..ed998c1 100644 --- a/library/src/main/ets/components/ImageKnifeAnimatorComponent.ets +++ b/library/src/main/ets/components/ImageKnifeAnimatorComponent.ets @@ -61,6 +61,7 @@ export struct ImageKnifeAnimatorComponent { .width(this.adaptiveWidth) .height(this.adaptiveHeight) .border(this.imageKnifeOption.border) + .clip(this.imageKnifeOption.border?.radius == undefined ? false : true) .state(this.animatorOption.state == undefined ? AnimationStatus.Running : this.animatorOption.state) .iterations(this.animatorOption.iterations == undefined ? -1 : this.animatorOption.iterations) .reverse(this.animatorOption.reverse == undefined ? false : this.animatorOption.reverse)