Skip to content

Commit 11fb310

Browse files
committed
references to this branch's file names fixed
1 parent 7c98706 commit 11fb310

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/chapters/chapter2.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,17 +334,17 @@ The third way, and the one Groceries uses, is to use platform-specific image res
334334
<b>Exercise</b>: Add a logo
335335
</h4>
336336

337-
In `login.xml`, add the `<Image>` below as the first child of the existing `<StackLayout>` tag:
337+
In `app.component.ts`, add the `<Image>` below as the first child of the existing `<StackLayout>` tag:
338338

339339
``` XML
340-
<Image src="res://logo" stretch="none" horizontalAlignment="center"></Image>
340+
<Image src="res://logo_login" stretch="none" horizontalAlignment="center"></Image>
341341
```
342342

343343
<div class="exercise-end"></div>
344344

345345
The `res://` syntax tells NativeScript to use a platform-specific resource, in this case an image. Platform-specific resources go in your app's `app/App_Resources` folder. If you look there you'll find a few different image files, several of which are named `logo.png`.
346346

347-
Although more complex than putting an image directly in the `app` folder, using platform-specific images gives you more control over image display on different device dimensions. For example iOS lets you provide three different image files for devices with different pixel densities. As such you'll find logos named `logo.png`, `logo@2x.png`, and `logo@3x.png` in your `App_Resources/iOS` folder. For Android you'll find similar image files in `App_Resources/Android/drawable-hdpi` (for "high" dpi, or high dots-per-inch), `App_Resources/Android/drawable-mdpi` (for medium-dpi), and `App_Resources/Android/drawable-ldpi` (for low-dpi).
347+
Although more complex than putting an image directly in the `app` folder, using platform-specific images gives you more control over image display on different device dimensions. For example iOS lets you provide three different image files for devices with different pixel densities. As such you'll find logos named `logo_login.png`, `logo_login@2x.png`, and `logo_login@3x.png` in your `App_Resources/iOS` folder. For Android you'll find similar image files in `App_Resources/Android/drawable-hdpi` (for "high" dpi, or high dots-per-inch), `App_Resources/Android/drawable-mdpi` (for medium-dpi), and `App_Resources/Android/drawable-ldpi` (for low-dpi).
348348

349349
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 `res://` and its base file name—i.e. `res://logo`. Here's what your login screen should look like on iOS and Android:
350350

0 commit comments

Comments
 (0)