【问题标题】:react native iPhone Plus text lines反应原生 iPhone Plus 文本行
【发布时间】:2018-02-13 12:32:35
【问题描述】:

应用程序中的所有多行文本标签都有线条。线条仅显示在 iPhone Plus 上,而不显示在 iPad、tab、android 或任何其他设备上。

知道如何解决吗?类似于下图的文本行:

import React, {Component} from "react";
import {
  Image,
  View,
  StatusBar,
  TouchableOpacity,
  WebView,
  Dimensions,
  Linking,
  ScrollView,
  NetInfo,
  Alert
} from "react-native";
import {
  Container,
  Header,
  Title,
  Content,
  Text,
  H3,
  Button,
  Icon,
  Footer,
  FooterTab,
  Left,
  Right,
  Body
} from "native-base";

class Test extends Component {

  constructor() {
    super();
  }

  render() {
    return (
      <Container style={styles.container}>

<View>
<Text> test test test test test test </Text>
</View>

      </Container>
    );
  }
}

export default Test;

【问题讨论】:

  • 这种情况发生在真机还是模拟器中。
  • 仅在真实设备上,但我现在通过为所有文本添加透明度解决了这个问题。

标签: iphone react-native native-base


【解决方案1】:

iPhone 7 Plus 在文本组件背景上显示线条,这也是 github 上已经报告的 react native 已知问题。要解决此问题,请添加以下样式:

 backgroundColor: 'transparent',

【讨论】:

  • 纯代码答案不是很有帮助。最好解释一下为什么这样可以解决问题。
猜你喜欢
  • 2020-12-19
  • 2018-09-11
  • 2023-03-12
  • 1970-01-01
  • 2018-02-15
  • 2017-11-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多