-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Description
选择一张图片之后,设置返回base64编码,将base64编码放到图片中,图片无法正常显示
<View style={{
width: 160,
height: 36,
backgroundColor: 'hsl(190,50%,70%)',
paddingHorizontal: 16,
paddingVertical: 8,
borderRadius: 8
}} onTouchEnd={() => {
launchImageLibrary({ mediaType: 'photo', selectionLimit: 1, maxWidth: 360, maxHeight: 100, includeBase64: true, quality: 0.5 }, (data) => {
const { base64 = '', type = '' } = data.assets[0]
let auri = `data:image/png;base64,${base64}`
setUri(auri)
})
}}>
<Text style={{ width: '100%', height: '100%', fontWeight: 'bold', textAlign: 'center' }}>选择</Text>
</View>
<Image
style={{ width: 300, height: 300 }}
source={{
uri: uri
}}></Image>
Metadata
Metadata
Assignees
Labels
No labels