1
我指的是通過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}}
in here時反應母語。如何用require
做到這一點?