Olli
Olli

Reputation: 532

imageView not showing ACS photo #appcelerator

Once opening profile page, I ran a Cloud.Users.showMe function. In this function I put this in

var upperppicview = Ti.UI.createImageView({
  image:'user.photo.urls.original',
  width: '70%',
    top: '10%',
    height: '80%',
    borderRadius: 5,
    left: '5%'
});
upperpview.add(upperppicview);

The view is there but not showing the image of the user, I have already uploaded the photo on arrowdb and passed the User(photo_id) the photo.id of the created photo. The photo was uploaded, it seemed to be attached backend as the user had an image attached but was not showing the particular image(as seen in the attachment below). How do I show the image as I need to also do this for events.

arrowdb

Upvotes: 0

Views: 104

Answers (2)

Mostafizur Rahman
Mostafizur Rahman

Reputation: 11

In your given code, image property value should be image location. It would be local or remote URL.

When you assign like image:'user.photo.urls.original' then image property value is string which is not local image or remote image locations that why its not working.

If you want to display from ACS server its store in user variable.

user is object so you need to set like image:user.photo.urls.original not image:'user.photo.urls.original'

Here is final code for image display in your apps will be

var upperppicview = Ti.UI.createImageView({
    image:user.photo.urls.original,
    width: '70%',
    top: '10%',
    height: '80%',
    borderRadius: 5,
   left: '5%'
   });

upperpview.add(upperppicview);

For more details please visit following link:

https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.ImageView-property-image https://docs.appcelerator.com/arrowdb/latest/#!/api/Users-property-photo

Thanks

Upvotes: 0

Sebastian
Sebastian

Reputation: 625

You put a string into your createImageView function.

Try this instead

var upperppicview = Ti.UI.createImageView({
  image:user.photo.urls.original,
  width: '70%',
    top: '10%',
    height: '80%',
    borderRadius: 5,
    left: '5%'
});
upperpview.add(upperppicview);

Upvotes: 2

Related Questions