我不断收到此错误,内容如下:
expo-app-loading 已弃用,取而代之的是 expo-splash-screen
这是 App.js 中我的启动屏幕的代码
export default function App() {
const [IsReady, SetIsReady] = useState(false);
const LoadFonts = async () => {
await useFonts();
};
if (!IsReady) {
return (
<AppLoading
startAsync={LoadFonts}
onFinish={() => SetIsReady(true)}
onError={() => {}}
/>
);
}
SplashScreen.hideAsync();
setTimeout(SplashScreen.hideAsync, 2000);
return (
<NavigationContainer style={styles.container}>
<UserStack/>
</NavigationContainer>
);
}
Run Code Online (Sandbox Code Playgroud) 我希望用户能够自动登录我的 .NET MAUI 应用程序。
我已经完成了登录系统,但我不知道如何在关闭应用程序后使登录保持不变。
这是到目前为止我的登录系统。
public partial class Login
{
// User credentials
string username;
string password;
// Try verification
public async Task LoginVerification()
{
// Check if credentials are valid in the database.
bool isValid = await CheckIfValid(username, password);
if (isValid)
{
Debug.WriteLine("User Was Found");
// Do stuff after succesful login.
}
else
{
Debug.WriteLine("User Not Found");
// Do stuff after unsuccesful login.
}
}
}
Run Code Online (Sandbox Code Playgroud)
我怎样才能让他们下次启动应用程序时不必输入凭据?