React Native文本显示截断异常问题求助
文本截断问题求助
显示文本截断情况的图片
如上图所示,文本“english”的末尾字母“h”被截断,“United states”仅显示“United”,无法完整展示内容。以下是我的代码:
<TouchableOpacity style={styles.container} onPress={onPress}> <Image source={imageSource} style={styles.image} /> <Text textBreakStrategy="simple" style={styles.title}>{title}</Text> <Text textBreakStrategy="simple" style={styles.subtitle}>{subtitle}</Text> </TouchableOpacity>
对应的样式表如下:
container: { display: "flex", flexDirection: "column", alignContent: "center", justifyContent: "center", alignItems: "center", textAlign: "center", width: 180, height: 136, Color: "#FFFFFF", border: "1px solid #00853E", borderColor: "#00853E", borderStyle: "solid", borderWidth: 1, boxShadow: "0px 4px 10px rgba(130, 130, 130, 0.25)", borderRadius: 3, }, image: { width: 76.92, height: 54.94, resizeMode: "contain", }, title: { marginTop: 7, fontStyle: "normal", fontWeight: 400, fontSize: 18, lineHeight: 23, color: "#00853E", }, subtitle: { fontStyle: "normal", fontWeight: 400, fontSize: 14, lineHeight: 23, color: "#3F3F3F", },
我已尝试使用textBreakStrategy="simple",还试过flex-wrap、overflow:'scroll'、alignSelf:'stretch'、textAlign:'center'等属性,但问题仍未解决。
内容的提问来源于stack exchange,提问作者Build Though
相关产品推荐
相关产品推荐

