Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-25220

Android: ImageView doesn't accept File

    Details

    • Story Points:
      3
    • Sprint:
      2017 Sprint 18 SDK

      Description

      Summary:
      In 6.2.0.RC getFile() returns a FileProxy that can't be shown in an ImageView

      Steps:

      • Create a default Titanium Classic project
      • add this code:

         
        var win = Ti.UI.createWindow({backgroundColor: 'grey'});
        var f = Ti.Filesystem.getFile("assets/images/tab1.png");
        if (f.exists()) {
        	console.log("file exists");
        	var img = Ti.UI.createImageView({
        		image: f,
        		top: 10
        	});
        	win.add(img);
         
        	var img2 = Ti.UI.createImageView({
        		image: f.nativePath
        	});
        	win.add(img2);
        } else {
        	console.log("file does not exists at " + f.nativePath);
        }
        win.open();
        

      Output

      6.1.2.GA shows both images:

      6.2.0.RC only shows one image:

      and this error:

      TiDrawableReference: (main) [83,83] Unknown image resource type: FileProxy. Returning null drawable reference
      

        Attachments

          Activity

            People

            • Assignee:
              gmathews Gary Mathews
              Reporter:
              michael Michael Gangolf
              Reviewer:
              Yordan Banev
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-11096
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code