From dee4ea8ea348937340fc5d5f005c2cfc042d3452 Mon Sep 17 00:00:00 2001 From: Ryan Anderson Date: Tue, 22 Sep 2015 10:00:19 -0700 Subject: [PATCH 1/3] Add note about PNG files to Image static resources --- docs/Image.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/Image.md b/docs/Image.md index 86101eb33..6d438e81b 100644 --- a/docs/Image.md +++ b/docs/Image.md @@ -27,6 +27,10 @@ When your entire codebase respects this convention, you're able to do interestin *This process is currently being improved, a much better workflow will be available shortly.* +> **NOTE**: PNG images are required when loading with `require('image!my-icon')` +> +> At this time, only PNG images are supported in iOS. There is an [issue](https://github.com/facebook/react-native/issues/646) that is currently addressing this bug. In the meantime a quick fix is to rename your files to image.png or to use the `isStatic` flag like: `source={{ uri: 'image', isStatic: true }}`. + ### Adding Static Resources to your Android app Add your images as [bitmap drawables](http://developer.android.com/guide/topics/resources/drawable-resource.html#Bitmap) to the android project (`/android/app/src/main/res`). To provide different resolutions of your assets, check out [using configuration qualifiers](http://developer.android.com/guide/practices/screens_support.html#qualifiers). Normally, you will want to put your assets in the following directories (create them under `res` if they don't exist): From a8b34a1516ed1eb3aaac6282db6107f6587c3ac5 Mon Sep 17 00:00:00 2001 From: Ryan Anderson Date: Thu, 24 Sep 2015 23:37:33 -0700 Subject: [PATCH 2/3] remove isStatic and change image to my-icon --- docs/Image.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Image.md b/docs/Image.md index 6d438e81b..a9a9ce046 100644 --- a/docs/Image.md +++ b/docs/Image.md @@ -29,7 +29,7 @@ When your entire codebase respects this convention, you're able to do interestin > **NOTE**: PNG images are required when loading with `require('image!my-icon')` > -> At this time, only PNG images are supported in iOS. There is an [issue](https://github.com/facebook/react-native/issues/646) that is currently addressing this bug. In the meantime a quick fix is to rename your files to image.png or to use the `isStatic` flag like: `source={{ uri: 'image', isStatic: true }}`. +> At this time, only PNG images are supported in iOS. There is an [issue](https://github.com/facebook/react-native/issues/646) that is currently addressing this bug. In the meantime a quick fix is to rename your files to image.png or to use the `uri` flag like: `source={{ uri: 'my-icon' }}`. ### Adding Static Resources to your Android app From 6dfadba318e70dfd70f8f1a5214de10efae5e475 Mon Sep 17 00:00:00 2001 From: Ryan Anderson Date: Fri, 25 Sep 2015 09:34:07 -0700 Subject: [PATCH 3/3] fix images docs verbiage --- docs/Image.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Image.md b/docs/Image.md index a9a9ce046..e3dbe599e 100644 --- a/docs/Image.md +++ b/docs/Image.md @@ -29,7 +29,7 @@ When your entire codebase respects this convention, you're able to do interestin > **NOTE**: PNG images are required when loading with `require('image!my-icon')` > -> At this time, only PNG images are supported in iOS. There is an [issue](https://github.com/facebook/react-native/issues/646) that is currently addressing this bug. In the meantime a quick fix is to rename your files to image.png or to use the `uri` flag like: `source={{ uri: 'my-icon' }}`. +> At this time, only PNG images are supported in iOS. There is an [issue](https://github.com/facebook/react-native/issues/646) that is currently addressing this bug. In the meantime a quick fix is to rename your files to my-icon.png or to use the `uri` property like: `source={{ uri: 'my-icon' }}` instead of `require()`. ### Adding Static Resources to your Android app