Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update layout.md #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ keywords: Flutter约束
## 介绍

在Flutter中,widget由其底层的[`RenderBox`](https://docs.flutter.io/flutter/rendering/RenderBox-class.html)对象渲染。
渲染框由它们的父级给出约束,并且在这些约束下调整自身大小。约束由最小宽度、最大宽度和高度组成; 尺寸由特定的宽度和高度组成。
渲染框由它们的父级给出约束,并且在这些约束下调整自身大小。约束由最小、最大的宽度和高度组成; 尺寸由特定的宽度和高度组成。

通常,按照widget如何处理他们的约束来看,有三种类型的盒子:

Expand Down Expand Up @@ -48,7 +48,7 @@ Flutter中的许多盒子,特别是那些只包含一个子widget的,都会
一个本身试图占用尽可能大的渲染盒在给定无边界约束时不会有用,在检查模式下(译者语:指Dart的checked模式),会抛出异常。

渲染盒具有无边界约束的最常见情况是在自身处于弹性盒([`Row`](https://docs.flutter.io/flutter/widgets/Row-class.html)
和 [`Column`](https://docs.flutter.io/flutter/widgets/Column-class.html))内以及可滚动区域 ([`ListView`](https://docs.flutter.io/flutter/widgets/ListView-class.html) 和其他[`ScrollView`](https://docs.flutter.io/flutter/widgets/ScrollView-class.html)的子类)内。
和 [`Column`](https://docs.flutter.io/flutter/widgets/Column-class.html))内,并且那个弹性盒处于可滚动区域 ([`ListView`](https://docs.flutter.io/flutter/widgets/ListView-class.html) 和其他[`ScrollView`](https://docs.flutter.io/flutter/widgets/ScrollView-class.html)的子类)内。

特别是,[`ListView`](https://docs.flutter.io/flutter/widgets/ListView-class.html)试图扩充以适应其横向可用空间(即,如果它是一个垂直滚动块,它将尝试与其父项一样宽)。
如果您ListView在水平滚动的情况下嵌套垂直滚动的ListView,则内部滚动区域会尽可能宽,这是无限宽的,因为外部滚动区域可以在水平方向上一直滚动。
Expand Down