更改输入组件的 NativeBase 主题中的字体大小

xLi*_*inn 2 themes input react-native native-base

我使用 NativeBase输入组件服装主题,我尝试更改服装主题中输入组件的字体大小我已经尝试在以下示例中更改它,但它没有改变。

如何更改服装主题中输入组件的字体大小?

示例1:

const themeOne = extendTheme({
  components: {
    Input: {
      baseStyle: {
        style: { color: "white", fontSize: "20" },
      },
    },
  },
});
Run Code Online (Sandbox Code Playgroud)

示例2:

const themeOne = extendTheme({
  components: {
    Input: {
      baseStyle: {
        style: { color: "white"},
        fontSize: "20",
      },
    },
  },
});
Run Code Online (Sandbox Code Playgroud)

小智 5

您可以使用defaultProps。阅读有关自定义输入组件的更多信息。

const theme = extendTheme({
    components: {
      Input: {
        baseStyle: {
          color: 'red.400',
        },
        defaultProps: { size: '2xl' },
      },
    },
  });
Run Code Online (Sandbox Code Playgroud)