@属性 android的阴影的颜色默认就只有黑色,目前颜色色值只适配iOS
shadowColor —–阴影的颜色,颜色色值以rgba取色值
shadowOffset —-阴影的偏移量,{width:0, height:2}
shadowOpacity —设置阴影的不透明度
shadowRadius —-设置阴影的模糊半径
 

代码样式如下:
elevation: 20, // 适配android的
shadowOffset: { width: 0, height: 3.5 }, // 以下4项适配ios
shadowColor: OAColor.black,
shadowOpacity: 0.15,
shadowRadius: 5

noticeInner: {
    flexDirection: 'row',
    justifyContent: 'space-between',
    alignItems: 'center',
    height: OASize(44),
    borderRadius: OASize(5),

    elevation: 20, // android 阴影 以下四项属于ios
    shadowOffset: { width: 0, height: 0 },
    shadowColor: OAColor.black,
    shadowOpacity: 0.15,
    shadowRadius: 5
},

 

效果图如下: 

 

Logo

开源鸿蒙跨平台开发社区汇聚开发者与厂商,共建“一次开发,多端部署”的开源生态,致力于降低跨端开发门槛,推动万物智联创新。

更多推荐