Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2163] MaskedImage does not work in ListView template on device

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionFixed
Resolution Date2013-10-20T14:51:18.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterMichael Descher
AssigneeEric Wieber
Created2013-10-17T18:30:47.000+0000
Updated2016-03-08T07:41:08.000+0000

Description

When using a MaskedImage in a ListView template all works fine in the simulator. On the actual device however the app crashes with a class not found error. I attached a simple test case which shows the problem (you have to add a test.png image to to project). It works fine in the simulator but crashes on the iPhone 5S with iOS 7.0.2. Also attached the logs from the device.

Attachments

FileDateSize
app.js2013-10-17T18:30:47.000+0000516
crashlog.txt2013-10-17T18:30:47.000+000036365
log.txt2013-10-17T18:30:47.000+00003727

Comments

  1. Michael Descher 2013-10-19

    Seems to be some class loading issue. I added the call "Titanium.UI.createMaskedImage()" as the very first line in my app and that made it work.
  2. Mostafizur Rahman 2013-10-20

    Hello Michael Descher, Is it working well in your device? Thanks
  3. Michael Descher 2013-10-20

    Yes, when I add an explicit createMaskedImage call in the app before the ListView uses the MaskedImage in the template it works fine on my iPhone 5s with iOS 7.0.2.
  4. Jong Eun Lee 2013-12-24

    I added added the call "Titanium.UI.createMaskedImage()" as the very first line in my app and that made it work. But it is a bug, isn't it? Please fix this bug. I was struggling to find the reason. I hope that there is no person to make it work.
  5. Eric Wieber 2013-12-26

    Hi Jong, This is not a bug but is as designed. Using createMaskedImage() is the correct way to use masked images. When apps are run on the simulator, many more libraries and resources are loaded than if the app is run on a device (which only loads the resources you specify). These resources allow for the masked images to work as called in the above sample, however using a string for masked images in a template is still not supported with devices. So, to have your apps work correctly on simulators and devices, use createMaskedImage(). I hope that helps make things a little clearer. Please let me know if you still have questions.

JSON Source