首页 > 解决方案 > 我可以将来自 aws-amplify-react-native 的错误消息对齐为中心吗

问题描述

我需要将错误消息与警告图标的中心对齐。它来自 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>
)
}

在此处输入图像描述

标签: react-nativestylesheetaws-amplifyaws-amplify-cli

解决方案


<View style={{flexDirection:'row', alignItems:'center'>
<Icon/>
<Text>{warningmessage}</Text>
</View>

这个 alignItems on row 将解决您的问题。


推荐阅读