小编Ana*_*las的帖子

无法在本机反应中格式化古兰经页面

我正在制作一个应用程序来阅读古兰经,使用本机反应(世博会)。我在格式化文本时遇到一些问题。

问题:

  • 随机间距
  • 自动调整文字大小
  • 文本最后在左侧对齐。

这是我的代码:

function Read(){
    return (
    <SafeAreaView style={styles.container}>
      <HeaderSurahScreen navigation={navigation} route={route} />
      <Divider
        orientation="vertical"
        width={5}
        style={{ borderBottomColor: "#545353" }}
      />

      {/* create a logic here to display tranlition or arabic */}
      <ScrollView style={styles.scroll}>
        <Text style={styles.surahPage} adjustsFontSizeToFit>
          {surah &&
            surah.map((ayat, index) => (
              <Text key={index} allowFontScaling={false} selectable={true}>
                <Text selectable={true} style={styles.ayat}>
                  {ayat.text}
                </Text>
                <Text style={styles.number}>{toArabic(ayat.id)}&#1757;</Text>
              </Text>
            ))}
        </Text>
      </ScrollView>
      <StatusBar style="auto" />
    </SafeAreaView>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: DEFAULT_BACKGROUND_COLOR_THEME,
  },
  scroll: { …
Run Code Online (Sandbox Code Playgroud)

reactjs react-native expo react-native-stylesheet

5
推荐指数
1
解决办法
569
查看次数