expo / react-native-read-more-text

583 stars 114 forks source link

Read More text is not showing on Android Device. #45

Open snevula123456 opened 3 years ago

snevula123456 commented 3 years ago

I am Trying to Use Read More text on Android and IOS Devices. Read More text is working fine in the IOS and while Android Device, it is no showing intermittently on the screens. may I know the reason Why? am I missing something?\

I am attaching the ref code.

// Read More Handlers const renderTruncatedFooter = (handlePress: any) => { return (

Read more
    );
};

const renderRevealedFooter = (handlePress: any) => {
    return (
        <Text style={subscriptionStyles.showLess} onPress={handlePress}>
            Show less
        </Text>
    );
};

// JSX <ReadMore numberOfLines={2} renderTruncatedFooter={renderTruncatedFooter} renderRevealedFooter={renderRevealedFooter}

{subscriptionData.commitmentText}

image

groteworld commented 3 years ago

I'm also getting this intermittent issue. Anecdotally, it seems to be on my Samsung devices more than my Pixel devices, but it seems to be specifically with Android.

My Code:

...

  renderTruncatedFooter(handlePress) {
    return (
      <TouchableOpacity onPress={handlePress}>
        <Text>Show More</Text>
      </TouchableOpacity>
    );
  }

  renderRevealedFooter(handlePress) {
    return (
      <TouchableOpacity onPress={handlePress}>
        <Text>Show Less</CRText>
      </TouchableOpacity>
    );
  }

  render() {
    return (
      <View style={styles.detailContainer}>
        <ReadMore
          textProps={{
            allowFontScaling: false,
          }}
          numberOfLines={3}
          renderTruncatedFooter={this.renderTruncatedFooter}
          renderRevealedFooter={this.renderRevealedFooter}
        >
          <Text>{this.props.text}</Text>
        </ReadMore>
      </View>
    );
  }
}
Andrew-Jang commented 2 years ago

I'm getting this issue as well

kylegillen commented 2 years ago

Me too

ahmed-khlifi commented 1 year ago

Any solution for this?