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
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -448,7 +448,7 @@ <h4 class="exercise-start">
448
448
<divclass="exercise-end"></div>
449
449
450
450
<p>NativeScript supports CSS's <code>@import</code> statement for importing one CSS file into another. So this new line of code imports the CSS rules from <code>platform.css</code> into <code>app.css</code>. But, you might have noticed that Groceries does not have a file named <code>platform.css</code>—only <code>app/platform.android.css</code> and <code>app/platform.ios.css</code> exist. What's going on here?</p>
451
-
<p><aid="platform-specific-files"></a>When you execute <code>tns run</code>, or <code>tns livesync</code>, the NativeScript CLI takes your code from the<code>app</code> folder and places it in the native projects located in the <code>platforms/ios</code> and <code>platforms/android</code> folders. Here the naming convention comes in: while moving files, the CLI intelligently selects <code>.android.*</code> and <code>.ios.*</code> files. To give a specific example, the CLI moves <code>platform.ios.css</code> into <code>platforms/ios</code> and renames it to <code>platform.css</code>; similarly, the CLI moves <code>platform.android.css</code> into <code>platforms/android</code>, and again renames it to <code>platform.css</code>. This convention provides a convenient way to branch your code to handle iOS and Android separately, and it's supported for any type of file in NativeScript—not just CSS files. You'll see a few more examples of this convention later in this guide.</p>
451
+
<p><aid="platform-specific-files"></a>When you execute <code>tns run</code>, or <code>tns livesync</code>, the NativeScript CLI takes the code from your<code>app</code> folder and places it in the native projects located in the <code>platforms/ios</code> and <code>platforms/android</code> folders. Here the naming convention comes in: while moving files, the CLI intelligently selects <code>.android.*</code> and <code>.ios.*</code> files. To give a specific example, the CLI moves <code>platform.ios.css</code> into <code>platforms/ios</code> and renames it to <code>platform.css</code>; similarly, the CLI moves <code>platform.android.css</code> into <code>platforms/android</code>, and again renames it to <code>platform.css</code>. This convention provides a convenient way to branch your code to handle iOS and Android separately, and it's supported for any type of file in NativeScript—not just CSS files. You'll see a few more examples of this convention later in this guide.</p>
452
452
<p>With these changes in place, you'll notice that the app has a bit more spacing, and also that the text fields have borders on iOS but that Android:</p>
<p>Open your app’s <code>app/app.component.ts</code> file and add a <code>styleUrls</code> property such that that full <code>@Component</code> declaration now looks like this:</p>
462
+
<p>Open your <code>app/app.component.ts</code> file and add a <code>styleUrls</code> property, so that that full <code>@Component</code> declaration now looks like this:</p>
463
463
<pre><codeclass="lang-JavaScript">@Component({
464
464
selector: "my-app",
465
465
template: `
@@ -507,7 +507,7 @@ <h4 class="exercise-start">
507
507
<b>Exercise</b>: Add an <code>id</code> attribute
508
508
</h4>
509
509
510
-
<p>Open your app’s <code>app/app.component.ts</code> file, find <code><Button text="Sign in"></Button></code> in your component’s <code>template</code>, and replace it with the code below:</p>
510
+
<p>Open your <code>app/app.component.ts</code> file, find <code><Button text="Sign in"></Button></code> in your component’s <code>template</code>, and replace it with the code below:</p>
<p>Once these files are in place the NativeScript framework knows how to pick the correct file; all you have to do is reference the image using <code>res://</code> and its base file name—i.e. <code>res://logo_login</code>. Here's what your login screen should look like on iOS and Android:</p>
<p>At this point your UI looks good, but the app still doesn't actually do anything. Let's look at how you can use JavaScript to add some functionality.</p>
542
+
<p>At this point your UI looks better visually, but the app still doesn't actually do anything. Let's look at how you can use JavaScript to add some functionality.</p>
543
543
<blockquote>
544
544
<p><strong>TIP</strong>: The community-written <ahref="http://nsimage.brosteins.com/">NativeScript Image Builder</a> can help you generate images in the appropriate resolutions for iOS and Android.</p>
Copy file name to clipboardExpand all lines: src/chapters/chapter2.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -276,7 +276,7 @@ TextField {
276
276
277
277
NativeScript supports CSS's `@import` statement for importing one CSS file into another. So this new line of code imports the CSS rules from `platform.css` into `app.css`. But, you might have noticed that Groceries does not have a file named `platform.css`—only `app/platform.android.css` and `app/platform.ios.css` exist. What's going on here?
278
278
279
-
<aid="platform-specific-files"></a>When you execute `tns run`, or `tns livesync`, the NativeScript CLI takes your code from the`app` folder and places it in the native projects located in the `platforms/ios` and `platforms/android` folders. Here the naming convention comes in: while moving files, the CLI intelligently selects `.android.*` and `.ios.*` files. To give a specific example, the CLI moves `platform.ios.css` into `platforms/ios` and renames it to `platform.css`; similarly, the CLI moves `platform.android.css` into `platforms/android`, and again renames it to `platform.css`. This convention provides a convenient way to branch your code to handle iOS and Android separately, and it's supported for any type of file in NativeScript—not just CSS files. You'll see a few more examples of this convention later in this guide.
279
+
<aid="platform-specific-files"></a>When you execute `tns run`, or `tns livesync`, the NativeScript CLI takes the code from your`app` folder and places it in the native projects located in the `platforms/ios` and `platforms/android` folders. Here the naming convention comes in: while moving files, the CLI intelligently selects `.android.*` and `.ios.*` files. To give a specific example, the CLI moves `platform.ios.css` into `platforms/ios` and renames it to `platform.css`; similarly, the CLI moves `platform.android.css` into `platforms/android`, and again renames it to `platform.css`. This convention provides a convenient way to branch your code to handle iOS and Android separately, and it's supported for any type of file in NativeScript—not just CSS files. You'll see a few more examples of this convention later in this guide.
280
280
281
281
With these changes in place, you'll notice that the app has a bit more spacing, and also that the text fields have borders on iOS but that Android:
282
282
@@ -293,7 +293,7 @@ Much like on the web, sometimes in your NativeScript apps you want to write CSS
293
293
<b>Exercise</b>: Add component-specific CSS
294
294
</h4>
295
295
296
-
Open your app’s `app/app.component.ts` file and add a `styleUrls` property such that that full `@Component` declaration now looks like this:
296
+
Open your `app/app.component.ts` file and add a `styleUrls` property, so that that full `@Component` declaration now looks like this:
297
297
298
298
```JavaScript
299
299
@Component({
@@ -351,7 +351,7 @@ Before we see what your app looks like now, there’s one small change you need
351
351
<b>Exercise</b>: Add an `id` attribute
352
352
</h4>
353
353
354
-
Open your app’s `app/app.component.ts` file, find `<Button text="Sign in"></Button>` in your component’s `template`, and replace it with the code below:
354
+
Open your `app/app.component.ts` file, find `<Button text="Sign in"></Button>` in your component’s `template`, and replace it with the code below:
355
355
356
356
```XML
357
357
<Buttontext="Sign in"id="submit-button"></Button>
@@ -405,6 +405,6 @@ Once these files are in place the NativeScript framework knows how to pick the c
405
405

406
406

407
407
408
-
At this point your UI looks good, but the app still doesn't actually do anything. Let's look at how you can use JavaScript to add some functionality.
408
+
At this point your UI looks better visually, but the app still doesn't actually do anything. Let's look at how you can use JavaScript to add some functionality.
409
409
410
410
> **TIP**: The community-written [NativeScript Image Builder](http://nsimage.brosteins.com/) can help you generate images in the appropriate resolutions for iOS and Android.
0 commit comments