You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.html
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1368,7 +1368,7 @@ <h4 class="exercise-start">
1368
1368
<imgsrc="images/chapter4/ios/4.png" alt="Grocery data on iOS"></p>
1369
1369
<p>At this point you have a list of data associated with each account, but a grocery list isn’t very useful if you can’t add new groceries to the list. Let’s look at how to do that next.</p>
1370
1370
<h3id="gridlayout">GridLayout</h3>
1371
-
<p>In order to allow users to add to their grocery lists you need to add a few additional UI controls to the list page. While you could layout these elements with a <code><StackLayout></code>, let’s look at how to create a slightly more complex layout using the <code><GridLayout></code> element.</p>
1371
+
<p>In order to allow users to add to their grocery lists, you need to add a few additional UI controls to the list page. While you could use a simple <code><StackLayout></code> to stack up the controls you need, let’s look at how to create a slightly more complex layout using the <code><GridLayout></code> element.</p>
<p>The outer grid layout’s <code>rows</code> attribute divides the screen into two rows, the first auto-sized according to its childrens' height, and the other to contain *, or the remaining height of the screen. You place UI elements into these rows using the zero-based <code>row</code> attribute. You place inner grid layout in the top row with the <code>row="0"</code> attribute, and the list view in the bottom row with the<code>row="1"</code> attribute.</p>
1403
+
<p>The outer grid layout’s <code>rows</code> attribute divides the screen into two rows, the first auto-sized according to its childrens' height, and the other to sized to take up *, or the remaining height of the screen. You place UI elements into these rows using the zero-based <code>row</code> attribute. The inner grid layout is in the top row because of its <code>row="0"</code> attribute, and the list view is in the bottom row because of its<code>row="1"</code> attribute.</p>
1404
1404
<p>Grid layouts can also divide the screen into columns, which is what the inner grid layout does:</p>
<p>Here the <code>columns</code> attribute divides the top of the screen into two columns. The <code>col="0"</code> attribute puts the text field in the first column, and the <code>col="1"</code> attribute puts the plus image in the last column. Grid layouts are the most commonly used NativeScript layout, so you may wish to take a minute to play around with the <code>columns</code> and <code>rows</code> attributes to figure out how they work.</p>
1410
+
<p>Here the <code>columns</code> attribute divides the top of the screen into two columns. The <code>col="0"</code> attribute puts the text field in the first column, and the <code>col="1"</code> attribute puts the “+” image in the last column. Grid layouts are the most commonly used NativeScript layout, so you may wish to take a minute to play around with the <code>columns</code> and <code>rows</code> attributes to figure out how they work.</p>
<p>With these attributes in place, your next steps are to define the <code>grocery</code> property and the <code>add()</code> method. To do that, open <code>app/pages/list/list.component.ts</code> and add the following property to the <code>ListPage</code> class (right below the existing <code>groceryList</code> property):</p>
1429
+
<p>With these attributes in place, your next steps are to define a new <code>grocery</code> property and <code>add()</code> method in your <code>ListPage</code> class. To do that, open <code>app/pages/list/list.component.ts</code> and add the following property to the <code>ListPage</code> class (right below the existing <code>groceryList</code> property):</p>
@@ -440,7 +440,7 @@ To break down how this layout works, let’s start with the outer structure of t
440
440
</GridLayout>
441
441
```
442
442
443
-
Theoutergridlayout’s`rows`attributedividesthescreenintotworows, thefirstauto-sizedaccordingtoitschildrens' height, and the other to contain *, or the remaining height of the screen. You place UI elements into these rows using the zero-based `row` attribute. You place inner grid layout in the top row with the `row="0"` attribute, and the list view in the bottom row with the `row="1"` attribute.
443
+
Theoutergridlayout’s`rows`attributedividesthescreenintotworows, thefirstauto-sizedaccordingtoitschildrens' height, and the other to sized to take up *, or the remaining height of the screen. You place UI elements into these rows using the zero-based `row` attribute. The inner grid layout is in the top row because of its `row="0"` attribute, and the list view is in the bottom row because of its `row="1"` attribute.
0 commit comments