ohos:color="$color:white"/>ohos:width="2"ohos:color="$color:red"/>ohos:radius="20"/>layout.xml中引用ohos:height="..._harmony 圆角">
当前位置:   article > 正文

harmonyos鸿蒙,HarmonyOS鸿蒙之设置圆角

harmony 圆角

1、同时设置四个角

2a357569a3d322dc88b70d4a20fd4fbd.png

a、静态设置

graphic下新建 background_supertext_red.xml

ohos:shape="rectangle">

ohos:color="$color:white"/>

ohos:width="2"

ohos:color="$color:red"/>

ohos:radius="20"/>

layout.xml中引用

ohos:height="50vp"

ohos:width="match_parent"

ohos:background_element="$graphic:background_supertext_red"

ohos:margin="20vp"

ohos:text="按钮"

ohos:text_size="20fp"/>

b、动态设置,不在layout.xml中通过ohos:background_element引用,通过代码动态设置

Button button = (Button) findComponentById(Re

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/267777
推荐阅读
相关标签
  

闽ICP备14008679号