首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >React-末尾的原生长文本消失器

React-末尾的原生长文本消失器
EN

Stack Overflow用户
提问于 2020-11-12 14:08:38
回答 2查看 66关注 0票数 0

我使用的是React-Native版本0.60.0。< /Text >组件未显示完整的长文本,例如超过5000个字符。React native仅显示有限的字符。我试过很多汤,但都不管用。同样的问题也发生在Android和iOS上。请帮助我解决这个问题。

screenshot

完整的代码-

代码语言:javascript
复制
class App extends Component {
  render() {

    let epiComment = "the speed of transmission is an important point of difference between the two viruses. influenza has a shorter median incubation period (the time between infection and onset of symptoms) and a shorter serial interval (the time between successive cases) than covid-19 virus. the serial interval for covid-19, data to date suggest that 80% of infections are mild or asymptomatic, 15% are severe infections, requiring oxygen, and 5% are critical infections, requiring ventilation. these fractions of severe and critical infection would be higher than those observed for influenza infection. those most at risk of severe influenza infection are children, pregnant women, the elderly, people with underlying chronic diseases and immunocompromised individuals. for covid-19, our current understanding is that advanced age and underlying conditions increase the risk of severe infection. the people most at risk of influenza infection the rate of transmission is an important point of difference between the two viruses. influenza has a shorter median incubation period (the time between infection and onset of symptoms) and a shorter serial interval (the time between successive cases) than covid-19. the serial interval for covid-19 is estimated to be 5-6 days, while for influenza virus, the serial interval is 3 days. this means that influenza can spread more rapidly than covid-19.the speed of transmission is an important point of difference between the two viruses. influenza has a shorter median incubation period (the time between infection and onset of symptoms) and a shorter serial interval (the time between successive cases) than covid-19 virus. the serial interval for covid-19 virus is estimated to be 5-6 days, while for influenza virus the serial interval is 3 days. this means that influenza can spread more rapidly than covid-19. in addition, transmission during the first 3-5 days of illness, or potentially presymptomatic transmission - transmission of the virus before the onset of symptoms - is an important factor in the transmission of influenza. on the other hand, although we are learning that some people may shed the covid-19 virus 24 to 48 hours before the onset of symptoms, this does not appear to be a major factor in transmission at this time.(the time between infection and onset of symptoms) and a shorter serial interval (the time between successive cases) than covid-19. the serial interval for covid-19 is estimated to be 5-6 days, while for influenza virus, the serial interval is 3 days. this means that influenza can spread more rapidly than covid-19.************"
    return (     
        <ScrollView >
        <Text>
          {epiComment}
        </Text>
        </ScrollView>
    );
  }
EN

回答 2

Stack Overflow用户

发布于 2020-11-12 15:16:49

试着这样做

代码语言:javascript
复制
<View style={{flexDirection:'row'}}> 
   <Text style={{flex: 1, flexWrap: 'wrap'}}> Your text here...</Text>
</View>
票数 0
EN

Stack Overflow用户

发布于 2020-11-13 23:54:53

Hi @Nitish我现在可以运行相同的代码了。在scroll上,我可以看到全文。snack.expo.io/n93fqzqgG

您只需要添加style和<SafeAreaView />作为父对象。下面是我的工作代码

代码语言:javascript
复制
import * as React from 'react';
import { Text, View, StyleSheet, ScrollView, SafeAreaView } from 'react-native';
import Constants from 'expo-constants';

export default function App() {
  let epiComment = "the speed of transmission is an important point of difference between the two viruses. influenza has a shorter median incubation period (the time between infection and onset of symptoms) and a shorter serial interval (the time between successive cases) than covid-19 virus. the serial interval for covid-19, data to date suggest that 80% of infections are mild or asymptomatic, 15% are severe infections, requiring oxygen, and 5% are critical infections, requiring ventilation. these fractions of severe and critical infection would be higher than those observed for influenza infection. those most at risk of severe influenza infection are children, pregnant women, the elderly, people with underlying chronic diseases and immunocompromised individuals. for covid-19, our current understanding is that advanced age and underlying conditions increase the risk of severe infection. the people most at risk of influenza infection the rate of transmission is an important point of difference between the two viruses. influenza has a shorter median incubation period (the time between infection and onset of symptoms) and a shorter serial interval (the time between successive cases) than covid-19. the serial interval for covid-19 is estimated to be 5-6 days, while for influenza virus, the serial interval is 3 days. this means that influenza can spread more rapidly than covid-19.the speed of transmission is an important point of difference between the two viruses. influenza has a shorter median incubation period (the time between infection and onset of symptoms) and a shorter serial interval (the time between successive cases) than covid-19 virus. the serial interval for covid-19 virus is estimated to be 5-6 days, while for influenza virus the serial interval is 3 days. this means that influenza can spread more rapidly than covid-19. in addition, transmission during the first 3-5 days of illness, or potentially presymptomatic transmission - transmission of the virus before the onset of symptoms - is an important factor in the transmission of influenza. on the other hand, although we are learning that some people may shed the covid-19 virus 24 to 48 hours before the onset of symptoms, this does not appear to be a major factor in transmission at this time.(the time between infection and onset of symptoms) and a shorter serial interval (the time between successive cases) than covid-19. the serial interval for covid-19 is estimated to be 5-6 days, while for influenza virus, the serial interval is 3 days. this means that influenza can spread more rapidly than covid-19.************"
    return (
        <SafeAreaView style={styles.container}> 
          <ScrollView >
            <Text>
              {epiComment}
            </Text>
          </ScrollView>
        </SafeAreaView>
    );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    paddingTop: Constants.statusBarHeight,
    margin: 8,
  },
});
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64798754

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档