我能否将错误消息对准aws-amplify-react-native的中心

问题描述 投票:0回答:2

我需要将错误消息与警告图标的中心对齐。它来自aws-amplify-react-native。

任何自定义方式?我正在使用屏幕,因为它与aws-react-native相同。

    import {
      Authenticator,
      AmplifyTheme,
      Greetings,
      SignIn,
      ConfirmSignIn,
      RequireNewPassword,
      SignUp,
      ConfirmSignUp,
      VerifyContact,
      ForgotPassword,
      AuthPiece,
    } from "aws-amplify-react-native";


render(){
      return(
           <Authenticator errorMessage={map}
                  hideDefault
                  amplifyConfig={awsmobile}
                  signUpConfig={signUpConfig}>
                    <Loading/>
                    <SignIn/>
                    <ConfirmSignIn/>
                    <VerifyContact/>
                    <SignUp signUpConfig={signUpConfig}/>
                    <ConfirmSignUp/>
                    <ForgotPassword/>
                    <RequireNewPassword />
                </Authenticator>
)
}

enter image description here

react-native stylesheet aws-amplify aws-amplify-cli
2个回答
0
投票
<View style={{flexDirection:'row', alignItems:'center'>
<Icon/>
<Text>{warningmessage}</Text>
</View>

行上的此alignItems将解决您的问题。


0
投票
  <View style={{flexDirection:'row'}}>
    <Icon/>
    <Text style={{textAlignVertical:"center"}}>{warningmessage}</Text>
    </View>

它将使文本垂直居中。添加textAlign: 'center',它将使文本居中[[水平。

© www.soinside.com 2019 - 2024. All rights reserved.