Comments (6)
Place the image (and shared assets) in src/assets
. Part of the symlink script copies this into nativescript/src/assets
so that the {N} app has access to the same contents.
https://github.com/TeamMaestro/angular-native-seed/blob/master/symlink.js#L17
from angular-native-seed.
I'm pretty sure that res://
references from the specific platforms App_Resources
folder. Android is a bit of a pain, because of all the sub folders & I'm not actually sure which folder represents which device type.
You have a few options to handle this.
- Adjust the
symlink.js
script to link./src/assets/images
to./nativescript/App_Resources/iOS
as well as all the miscellaneous Android folders (unless theres a main folder that applies to all of them). - Add a new script inside
nativescript/gulpfile.js
that copies images out ofnativescript/src/assets
and places them into the correctApp_Resources
folder as mentioned above.
That script may look like:
gulp.task('project.Images', () => {
return gulp.src([`${SRC}assets/*.png`, `${SRC}assets/*.jpg`, `${SRC}assets/*.gif`], { follow: true })
.pipe(gulp.dest('App_Resources/iOS'))
.pipe(gulp.dest('App_Resources/Android'));
});
then as part of this:
gulp.task(
'build.Default',
gulp.series(
'clean.Dist',
'resources.App_Resources',
'resources.Assets',
'project.Typescript',
'project.Styles',
'tns.Templates',
'tns.Styles',
'tns.Typescript'
)
);
add project.Images
to the series
function after project.Styles
.
from angular-native-seed.
if you don't want to create multiple drawables you can create a new folder in the App_Resources/android
name it drawable then drop your file there
from angular-native-seed.
Yes, but how can you access to these resources using the icon property? For example icon="res://menu"? I'm testing with ActionItems
from angular-native-seed.
@sean-perkins yeah, you'right. With Android is more difficult because each drawable folder represents the Display pixel density (ldpi/mdpi/hdpi/xhdpi/nodpi/tvdpi). I think manually is the best option for now 👍
Thanks for all my friend!
from angular-native-seed.
@triniwiz you're right my friend, that folder is for the default resources 🍻
from angular-native-seed.
Related Issues (20)
- Build failed when I run "npm i" in either web or native HOT 1
- error: attribute 'package' in <manifest> tag is not a valid Android package name: '__PACKAGE__'. HOT 1
- stopping tsc watch HOT 1
- Please update this seed to latest versions HOT 5
- Sharing for reference; a few tips
- Cannot find module './app/app.module' HOT 3
- How to use Icon Fonts with this project HOT 1
- Version of @angular/compiler-cli needs to be 2.3.1 or greater. Current version is "5.2.9". HOT 4
- npm run build-ios-bundle fails HOT 1
- Empty component on router.back
- Could not resolve module ./app/+about/about.module HOT 1
- Crash on Startup [ERROR BOOTSTRAPPING ANGULAR] HOT 8
- Should sass compilation be happening out of the box? HOT 2
- Fresh clone of repo - nativescript side won't build due to missing 'fonts' directory HOT 2
- Cannot find module '../../../../environments/environment'
- why stopped at "Xcode build...", when I run "npm run phone-is-bundle" command, but run "npm run phone-android-bundle" is working smoothly? HOT 3
- Environment variables for nativescript
- Is there a License on this project? HOT 2
- # in URL HOT 1
- How do I add WebPack and Angular Universal Build? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-native-seed.