使用 React Native ui kitten 增加按钮中的文本大小

Increasing text size in buttons with react native ui kitten

假设您有一个按钮并且按钮的大小非常合适,但文本大小与按钮的大小不匹配。

我应该如何增加按钮文本的大小。在它说要使用的文档中,StyleProp<TextStyle>,我一直在尝试使用它,但我觉得我缺乏正确的理解。

如果方向正确,我们将不胜感激。

<Button
  status="control"
  appearance="ghost"
  size="giant"
> title </Button>

我想您使用的自定义字体在 Eva 提供的默认配置下看起来不太好。 但是,您在这里有两个选择。通过 textStyle 属性提供文本样式,或者像我在相关 github issue.

中提到的那样修改映射

https://akveo.github.io/react-native-ui-kitten/docs/components/button/overview#button

这是解决方案,你可以通过改变size='giant'来改变它,例如,在你的样式中设置按钮的heightwidth,文本大小将保持大属性 size.

或者在 url 的末尾是如何使其对您的代码灵活,如果第一个选项不是好的解决方案。

我有同样的问题:)

button 及其内部视图可以通过将它们作为功能组件传递来设置样式。

import { Button, Text } from '@ui-kitten/components';

<Button style={...}>
  {evaProps => <Text {...evaProps} style={{color: "red"}}>BUTTON</Text>}
</Button>