在MAUI中创建表单的布局或视图

huangapple go评论98阅读模式
英文:

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

  1. 创建一个新的ContentPage,最外层的元素应该是Grid。

  2. 在Grid中添加一个ScrollView。

  3. 在ScrollView中添加VerticalStackLayout。

  4. 在VerticalStackLayout中添加标签(Labels)和输入框(Inputs)。

这将实现你所要求的功能。

以下是我的意见,随意忽略:

如今,在设计移动应用程序时,人们不再强迫用户通过将所有输入都放在一个页面上来滚动。相反,用户会被引导通过不同的步骤。作为一个程序员,你可能会认为这是额外的工作。对于用户来说,这种流程比无休止的上下滚动更加友好。

英文:
  1. Make a new ContentPage, the outer most element should be Grid.

  2. Add ScrollView to the Grid.

  3. Add VerticalStackLayout to the ScrollView.

  4. 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.

huangapple
  • 本文由 发表于 2023年7月24日 15:00:53
  • 转载请务必保留本文链接:https://go.coder-hub.com/76752077.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定