nativebase 中的大写按钮

Uppercase Button in nativebase

我有一个带有面子书图标的按钮

<Button iconLeft block > <Icon name='logo-facebook' /> <Text>Login with facebook</Text> </Button>

with text "Login with facebook" 但它显示 "LOGIN WITH FACEBOOK" 。我尝试使用 capitalize={false} 但没有 hope.Is 有什么办法吗? 注意 version:2.2.1

试试这个:

 text.capitalize-lowercase {text-transform: lowercase;}
text.capitalize-uppercase {text-transform: uppercase;}
<button iconleft block> <icon name='logo-facebook' /> <text class="capitalize-uppercase">Login with facebook</text> </button>
 <br/> <br/>
<button iconleft block> <icon name='logo-facebook' /> <text class="capitalize-lowercase">Login with facebook</text> </button>

我认为 React Native 目前不支持文本转换 style.So 你可以试试这样的方法

<Button iconLeft block > 
 <Icon name='logo-facebook' /> 
 <Text> {'Login with facebook'.toUpperCase()} </Text>
</Button>

您正在使用 Native Base 对吗?也许你可以试试这个。

您可以更改此代码:

<Button iconLeft block > 
 <Icon name='logo-facebook' /> 
 <Text> {'Login with facebook'.toUpperCase()} </Text>
</Button>

对此:

<Button iconLeft block > 
 <Icon name='logo-facebook' /> 
 <Text uppercase={false}> {'Login with facebook'.toUpperCase()} </Text>
</Button>

只是在你的<text>标签中使用了uppercase={false},希望对你有帮助:)