HarmonyOS NODE_LINEAR_GRADIENT设置问题
NODE_LINEAR_GRADIENT属性文档如下,但object格式描述不清晰,麻烦提供一下示例。
/**
* @brief Sets the gradient attribute, which can be set, reset, and obtained as required through APIs.
*
* Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n
* .value[0].f32: start angle of the linear gradient. A positive value indicates a clockwise rotation from the
* origin, (0, 0). The default value is <b>180</b>. \n
* .value[1].i32: direction of the linear gradient. It does not take effect when <b>angle</b> is set.
* The parameter type is {@link ArkUI_LinearGradientDirection}: \n
* .value[2].i32: whether the colors are repeated. The default value is <b>false</b>. \n
* .object: array of color stops, each of which consists of a color and its stop position.
* Invalid colors are automatically skipped. \n
* colors: colors of the color stops. \n
* stops: stop positions of the color stops. \n
* size: number of colors. \n
* \n
* Format of the return value {@link ArkUI_AttributeItem}: \n
* .value[0].f32: start angle of the linear gradient. \n
* .value[1].i32: direction of the linear gradient. It does not take effect when <b>angle</b> is set. \n
* .value[0].i32: whether the colors are repeated. \n
* .object: array of color stops, each of which consists of a color and its stop position.
* Invalid colors are automatically skipped. \n
* colors: colors of the color stops. \n
* stops: stop positions of the color stops. \n
* size: number of colors. \n
*
*/
NODE_LINEAR_GRADIENT,
HarmonyOS
赞
收藏 0
回答 1
待解决
相关问题
linear-gradient设置颜色的起止位置
799浏览 • 1回复 待解决
linear-gradient不支持start,end属性
810浏览 • 1回复 待解决
3516下载提示node.lib问题
8497浏览 • 2回复 已解决
HarmonyOS ArkUI有哪些类型的Node?
238浏览 • 1回复 待解决
k8s 在加入新 node 后的 pod 调度问题
2082浏览 • 1回复 待解决
关于node和mysql并发处理的小问题有知道的吗?
2436浏览 • 1回复 待解决
#鸿蒙通关秘籍#如何运用Linear Containers的动态扩容特性?
25浏览 • 1回复 待解决
HarmonyOS 启动页设置问题
533浏览 • 1回复 待解决
HarmonyOS Flex 布局设置问题
417浏览 • 1回复 待解决
kubectl get node修改name
2381浏览 • 0回复 待解决
HarmonyOS renderNode的frame设置问题
544浏览 • 1回复 待解决
HarmonyOS scroll的高度设置问题
860浏览 • 1回复 待解决
Task assembleHap not found in hvigor node: entry
1795浏览 • 1回复 待解决
HarmonyOS NODE_ALIGN_SELF使用方法描述有误
261浏览 • 1回复 待解决
HarmonyOS Tabs组件bar背景设置问题
369浏览 • 1回复 待解决
HarmonyOS web_view设置超时问题
359浏览 • 1回复 待解决
HarmonyOS 关于代理提醒的设置问题
442浏览 • 1回复 待解决
HarmonyOS Text的stateStyles设置fontColor问题
365浏览 • 1回复 待解决
Node-API的关键交互流程有哪些?
393浏览 • 1回复 待解决
HarmonyOS 图片背景及边框圆角设置问题
924浏览 • 1回复 待解决
HarmonyOS 关于动态设置组件宽度的问题
340浏览 • 1回复 待解决
Node-API的组成架构都有哪些?
345浏览 • 1回复 待解决
ConstraintSize尺寸设置问题
510浏览 • 1回复 待解决
可以参考NODE_RADIAL_GRADIENT的方式:
对于Linear的场景,可以根据需要调整value的值。