我无法按预期使用 textShadow 适当性。这是我的代码:
import React from 'react'
import { StyleSheet, View, Text } from 'react-native'
class Test extends React.Component {
render() {
return (
<View style={styles.main_container}>
<Text style={}>Some textooo</Text>
</View>
)
}
}
const styles = StyleSheet.create({
main_container: {
flex: 1,
justifyContent:'center',
alignItems:'center',
},
text: {
fontSize: 30,
fontWeight: '900',
textShadowColor: 'rgba(0, 0, 0, 0.8)',
textShadowOffset: { width: 0, height: 0 },
textShadowRadius: 10,
}
})
export default Test
这是它的渲染方式:
如您所见,阴影在文本的开头和结尾处被剪切......
有谁知道如何避免这种情况?(无需在要渲染的字符串中添加“”)
非常感谢您的帮助。