问题描述
大家好,我正在尝试使用 AWS Amplify 和 React Native 制作应用程序。我只想向我的应用程序添加一个背景图像,为了这个小目的,我不想创建一个完全自定义的组件来显示登录屏幕。这是我的代码。
import React,{ useEffect } from 'react';
import { Text,View,StyleSheet,StatusBar,imagebackground,Image } from 'react-native';
import SplashScreen from 'react-native-splash-screen';
import Amplify from 'aws-amplify';
import awsconfig from './aws-exports';
import { Authenticator,AmplifyTheme } from 'aws-amplify-react-native';
Amplify.configure(awsconfig);
console.disableYellowBox=true;
const App = function() {
useEffect(() => {
SplashScreen.hide();
},[]);
return(
<View style={styles.container}>
<StatusBar
barStyle = 'light-content'
backgroundColor='black'
/>
<Authenticator usernameAttributes="email" >
</Authenticator>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,justifyContent: 'center',alignItems: 'center',backgroundColor: 'black'
}
});
export default App;
我知道 imagebackground 应该可以完成这项工作,但我不知道如何将 Amplify 登录与其集成。
提前致谢。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)