react-native - 我可以将来自 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>
)
}
解决方案
<View style={{flexDirection:'row', alignItems:'center'>
<Icon/>
<Text>{warningmessage}</Text>
</View>
这个 alignItems on row 将解决您的问题。
推荐阅读
- sql - 在运行时是否有更清洁(即更快)的方式在 SQL 中进行计算?
- pine-script - “参考长度 max_bars_back”错误的问题
- r - R中的嵌套for循环,其中第二个索引在第一个索引内计数
- python - 从数据帧生成具有不同手段的场景
- javascript - JavaScript 对象在 for 循环中仅存储最新值
- r - 如何绘制多个 y 的回归线
- haskell - Haskell:有没有简单的方法来检查两个字符串是否有相同的字符?
- grafana - 无法从 Clickhouse 数据源绘制 Grafana 中的数据
- java - java - 如何在java中的jar中围绕类的方法实现方面
- java - 如何使用 Selenium 和 Java 单击按钮?