鸿蒙 如何实现一个渐变的圆形图片;

鸿蒙 如何实现一个渐变的圆形图片;-开源基础软件社区希望得到一个Element;

Image 设置上去;

 

 

鸿蒙
自定义
2021-04-20 09:17:52
浏览
收藏 0
回答 2
已解决
回答 2
按赞同
/
按时间
Denny_Mr.__佀
1

https://developer.huawei.com/consumer/cn/forum/topic/0201427460161210688?fid=0101303901040230869   这个你考参考一下  不保证一定解决 但是应该问题不大。

 

分享
微博
QQ
微信
回复1
2021-04-20 11:57:26
没用的喵叔
1

亲测,可行:

ShapeElement shapeElement = new ShapeElement();
shapeElement.setShape(ShapeElement.OVAL);
shapeElement.setShaderType(ShapeElement.RADIAL_GRADIENT_SHADER_TYPE);
RgbColor[] rgbColors = new RgbColor[]{new RgbColor(255,33, 31), new RgbColor(255, 255, 255)};
shapeElement.setRgbColors(rgbColors);

 

分享
微博
QQ
微信
回复7
2021-04-27 10:22:46
相关问题
组件如何实现渐变色?
41浏览 • 1回复 待解决
一个页面怎么实现多个AbilitySlice?
12106浏览 • 5回复 待解决
如何创建一个pgsql只读账户?
634浏览 • 2回复 待解决
如何通过DevEco新建一个js/tsmodule?
3322浏览 • 1回复 待解决
如何调用并测试一个wifi接口?
3740浏览 • 1回复 待解决
如何实现图片点击跳转?
3249浏览 • 1回复 待解决
js如何清空一个input 输入框内容
5364浏览 • 1回复 待解决
mysql左连接一个问题
413浏览 • 1回复 待解决
如何一个Component画到Pixelmap上呢?
341浏览 • 1回复 待解决
entry中如何拉起另一个Module中Ability
1664浏览 • 1回复 待解决