繁体   English   中英

当它应该在下一行继续时,文本在标题上被裁剪

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM