英文:
Layout or View for creating forms in MAUI
问题
哪种布局或视图在 MAUI 中创建类似表单页面时最合适?特别是需要容纳多个用户输入字段并需要滚动的情况。
我之前在原生 iOS 编程中一直使用静态的 TableView 来设计这样的表单视图。
英文:
Which is the most appropriate layout or view for creating a form like page in MAUI? Especially where multiple user input fields are to be accommodated and which will require scrolling.
Coming from native iOS programming where I've been using the static TableView to design such a form view.
答案1
得分: 1
-
创建一个新的ContentPage,最外层的元素应该是Grid。
-
在Grid中添加一个ScrollView。
-
在ScrollView中添加VerticalStackLayout。
-
在VerticalStackLayout中添加标签(Labels)和输入框(Inputs)。
这将实现你所要求的功能。
以下是我的意见,随意忽略:
如今,在设计移动应用程序时,人们不再强迫用户通过将所有输入都放在一个页面上来滚动。相反,用户会被引导通过不同的步骤。作为一个程序员,你可能会认为这是额外的工作。对于用户来说,这种流程比无休止的上下滚动更加友好。
英文:
-
Make a new ContentPage, the outer most element should be Grid.
-
Add ScrollView to the Grid.
-
Add VerticalStackLayout to the ScrollView.
-
Add Labels and Inputs to the VerticalStackLayout.
This will do what you are asking for.
The following is my opinion, feel free to ignore it:
Those days, when designing mobile apps, people do not force the users to scroll, by placing all the inputs in one page. Instead, the user is guided through different steps. As a programmer, you may consider this an extra work to be done. For the user, this flow is much more friendly than endless scrolling up and down.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论