Coder Social home page Coder Social logo

Comments (6)

fabdrol avatar fabdrol commented on September 15, 2024

Since Alloy doesn't seem to work, I tried the manual approach:

var avatar = require('ui').createView({
      backgroundImage: Alloy.Globals.Profile.get('avatar'),
      backgroundSize: "cover",
      borderRadius: 45,
      width: "106%",
      height: "106%",
      top: "-3%",
      left: "-3%"
    });

    $.avatar.removeAllChildren();
    $.avatar.add(avatar);

This also yields an error, although a different one.
[ERROR] [iphone, 8.4, 192.168.1.6] [UI] Could not write downloaded file to: file:///Users/Fabian/Library/Developer/CoreSimulator/Devices/9BA4D310-6A18-484B-A693-D9E098825FA9/data/Containers/Data/Application/43762E64-18BD-4AC4-9F0F-C8E60C4538EE/tmp/1f6ca17ecbc1b15cde12647104d1344091f3ecaa.com/696911963770382/picture.

When I try to use /image/foo.png, the other error appears.

from util.

FokkeZB avatar FokkeZB commented on September 15, 2024

Does the sample app work for you? I just ran that and it works fine with similar paths:

https://github.com/FokkeZB/UTiL/blob/master/app/views/ui.xml

from util.

botmaster avatar botmaster commented on September 15, 2024

Same issue.
Work great with remote url but fail with local image.
@fabdrol any workaround ?

from util.

botmaster avatar botmaster commented on September 15, 2024

Ok I found a solution.
Try to change the line 177 : originalFile = Ti.Filesystem.getFile(originalPath);
To : originalFile = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, originalPath);

from util.

FokkeZB avatar FokkeZB commented on September 15, 2024

Thanks @botmaster! Could you verify that works on both iOS and Android and send a PR?

from util.

botmaster avatar botmaster commented on September 15, 2024

That works on both iOS and Android.
PR send.

from util.

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.