GithubHelp home page GithubHelp logo

Comments (6)

sean-perkins avatar sean-perkins commented on May 30, 2024 1

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.

sean-perkins avatar sean-perkins commented on May 30, 2024 1

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.

  1. 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).
  2. Add a new script inside nativescript/gulpfile.js that copies images out of nativescript/src/assets and places them into the correct App_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.

triniwiz avatar triniwiz commented on May 30, 2024 1

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.

jdnichollsc avatar jdnichollsc commented on May 30, 2024

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.

jdnichollsc avatar jdnichollsc commented on May 30, 2024

@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.

jdnichollsc avatar jdnichollsc commented on May 30, 2024

@triniwiz you're right my friend, that folder is for the default resources 🍻

from angular-native-seed.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.