DEV Community

HarmonyOS
HarmonyOS

Posted on

Smart Watch API 6 Crash and error reporting in smartwatch applications:ElementScatterException: radius can only set in rectangle

Read the original article:Smart Watch API 6 Crash and error reporting in smartwatch applications: ElementScatterException: radius can only set in rectangle.

Problem description

Crash and error reporting in smartwatch applications: ElementScatterException: radius can only set in rectangle.

Solution

When referencing a graphic resource XML file, there is an error in the XML syntax.Specifically, when writing ohos:shape="oval", the corners attribute was incorrectly added.

When ohos:shape="oval", the corners attribute should not be present.

<?xml version="1.0" encoding="UTF-8" ?>
<shape xmlns:ohos="http://schemas.huawei.com/res/ohos"
       ohos:shape="oval">

    <bounds
        ohos:top="0"
        ohos:left="0"
        ohos:right="16px"
        ohos:bottom="16px"/>
    <solid
        ohos:color="#FFFFFF"/>
</shape>
Enter fullscreen mode Exit fullscreen mode

Applicable Scenarios

Smartwatch applications utilizing the shape XML resources, specifically for oval shapes.

Written by Kayra Enes Ozenalp

Top comments (0)