我指的是图像require
,我想从精灵图像中裁剪图标。
const sprite = require('./sprite.png')
const crop = {left: 10, top: 50, width: 20, height: 40}
export const cartLogo = sprite({crop})
// How do I apply the crop to the sprite?
then
<Image source={cartLogo}/>
{uri: 'url-to-image', crop: {left: 10, top: 50, width: 20, height: 40}}
我在这里看到如何在 react-native 中裁剪图像。怎么办require
?