[英]text getting cropped on title when it should continue on next line
<View
style={{
flexDirection: 'row',
alignItems: 'center',
height: 130,
marginVertical: 10,
overflow: 'hidden'
}}
>
<Image
source={{
uri: props.image_medium
}}
style={{
height: 120,
width: 120,
borderRadius: 10
}}
/>
<View style={{ marginLeft: 10 }}>
<Text
style={{
fontFamily: 'Montserrat_bold',
fontSize: 14,
color: Colors.NewBlue
}}
>
{props?.title.trim()}
</Text>
所以我只是將 flex:1 添加到包含視圖中
<View
style={{
flexDirection: 'row',
alignItems: 'center',
height: 130,
marginVertical: 10,
overflow: 'hidden'
}}
>
<Image
source={{
uri: props.image_medium
}}
style={{
height: 120,
width: 120,
borderRadius: 10
}}
/>
<View style={{ marginLeft: 10, flex:1}}> // right here
<Text
style={{
fontFamily: 'Montserrat_bold',
fontSize: 14,
color: Colors.NewBlue
}}
>
{props?.title.trim()}
</Text>
瞧
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.