如何使用 Xamarin.Forms
创建登录页面?
我正在 Android 设备上进行调试
在页面上,我尝试从 MSSQL 中的 MSSQL 数据库查询给定的用户名和密码
如果登录成功,页面会跳转到新页面,否则会显示验证失败。
如何在 Xamarin.Forms 中执行此操作?
最佳答案
(Xamarin LoginFlow
示例链接在答案底部)
您将拥有多个 Xamarin.Forms 页面,并使用 NavigationPage
将它们从(生命周期)堆栈中推送或弹出。
引用号:https://developer.xamarin.com/api/type/Xamarin.Forms.NavigationPage/
将每个页面
视为一个完整的独立迷你应用程序。因此,登录页面可能会以交互方式从用户那里获取用户 ID/密码,并通过执行 SQL 查询的 Rest api 通过服务器执行授权检查。如果登录成功,它将在 NavigationPage
堆栈上推送一个新的基于表单的页面。即
启动画面 -> 登录页面 -> 主页面
LoginFlow Xamarin example
This sample demonstrates how to manipulate the navigation stack in order to only display the main page of the application once the user has successfully logged in.
For more information about the sample see Hierarchical Navigation.
关于xamarin - 如何在 Xamarin.Forms 中创建登录页面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36736448/