将样式添加到React-native-paper按钮元素的图标中
我在与图标的反应纸纸中使用按钮。我只需要在按钮的图标中添加阴影样式。我发现的唯一可用选项是在按钮中添加高程。但是它应用于整个按钮,而不是仅应用于按钮的图标。
按钮的代码:
<Button
icon={icon}
onPress={onPress}
size={size}
color={color}
animated={animated}
disabled={disabled}
style={styles.btnStyles}
/>
添加阴影的按钮样式:
btnStyles: {
elevation: 40,
shadowColor: '#000',
backgroundColor: 'rgba(0,0,0,0)',
},
结果:
在此处输入图像描述
(在这里,您可以看到阴影应用于按钮,而不是内部的图标。)
我如何求解上述问题并仅在图标中添加阴影?
提前致谢。
I use button in react-native-paper with icon. I need to add a shadow style only to the icon of the button. The only available option I found was to add an elevation to the button. But it is applied to the whole button instead of applying only to the icon of the button.
The code of button:
<Button
icon={icon}
onPress={onPress}
size={size}
color={color}
animated={animated}
disabled={disabled}
style={styles.btnStyles}
/>
The Style of button to add shadow:
btnStyles: {
elevation: 40,
shadowColor: '#000',
backgroundColor: 'rgba(0,0,0,0)',
},
The result:
enter image description here
(Here you can see that the shadow is applied to the button, not to the icon inside.)
How can I solve above issue and add a shadow only to the icon?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论