【问题标题】:How can I change time text color?如何更改时间文本颜色?
【发布时间】:2020-06-29 07:26:33
【问题描述】:

我使用 react-native-gifted-chat 进行聊天。我想更改时间字体颜色。我按照医生说的改了,但是没有改。我想要两种时间颜色都是黑色的。 使用“react-native-gifted-chat”:“^0.16.1”

  const renderTime = (props) => {
    return (
      <Time
      {...props}
        textStyle={{
          left: {
            color: 'black',
          },
          right: {
            color: 'black',
          },
        }}
      />
    );
  };

【问题讨论】:

    标签: react-native react-native-gifted-chat


    【解决方案1】:

    看来您需要传递 timeTextStyle 而不是 textStyle

    试试:

      const renderTime = (props) => {
        return (
          <Time
          {...props}
            timeTextStyle={{
              left: {
                color: 'black',
              },
              right: {
                color: 'black',
              },
            }}
          />
        );
      };
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-06
      • 2018-03-03
      • 2016-10-12
      相关资源
      最近更新 更多