Git Product home page Git Product logo

Comments (7)

rph8 avatar rph8 commented on September 23, 2024

Could it be that this an issue with svgs?
.toUIImage seems to work fine for me with pngs, but with svgs I get nil as well.

from moko-resources.

Alex009 avatar Alex009 commented on September 23, 2024

svg works in samples. svg on iOS require iOS 13+, check your iOS version please

from moko-resources.

Danijal98 avatar Danijal98 commented on September 23, 2024

svg works in samples. svg on iOS require iOS 13+, check your iOS version please

I am using the iOS 17, so I think that should not be the issue

from moko-resources.

Alex009 avatar Alex009 commented on September 23, 2024

@Danijal98 please test your svg inside xcode project directly. maybe iOS for some reason can't process this svg

from moko-resources.

djehrlich avatar djehrlich commented on September 23, 2024

I’m seeing a similar issue with an SVG file on iOS. Interestingly, while in light mode, I see the image (.toUIImage() returns non-nil). However, when I switch to dark mode, I don’t see the image (.toUIImage() returns nil). Maybe this clue helps?

from moko-resources.

rph8 avatar rph8 commented on September 23, 2024

I’m seeing a similar issue with an SVG file on iOS. Interestingly, while in light mode, I see the image (.toUIImage() returns non-nil). However, when I switch to dark mode, I don’t see the image (.toUIImage() returns nil). Maybe this clue helps?

Is it maybe related to this one (should be fixed in the most recent version / beta)?
#543

from moko-resources.

djehrlich avatar djehrlich commented on September 23, 2024

I’m seeing a similar issue with an SVG file on iOS. Interestingly, while in light mode, I see the image (.toUIImage() returns non-nil). However, when I switch to dark mode, I don’t see the image (.toUIImage() returns nil). Maybe this clue helps?

Is it maybe related to this one (should be fixed in the most recent version / beta)? #543

Dark mode SVG images are indeed working. The comments for #624 provided the insight I needed - add an image resource with “-dark” appended to its name. I tested by copying “car_black.svg” to “car_black-dark.svg” and both light and dark mode now work as advertised.

from moko-resources.

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.