0

Well pretty straight forward.

FBProfilePictureView uses (by my knowing) all the UIImageView methods. Knowing this i tried to use AscpectToFit (first in the storyboard second in the code when the first one didn't work.

the i tried this:

   self.fb_background.contentMode = UIViewContentMode.ScaleToFill

This works only in height. I also tried resizing the frame this resulted in my images halfway down my page(instead of the top left

what am i doing wrong?

The problem is that my pictures width is not correct! its

Twizzler
  • 491
  • 1
  • 7
  • 25
  • I don't think FBProfilePictureView extends UIImageView. From the documentation it states that resizing frame may result in different size of image loaded. Give us a screenshot or explain better on what issue you are having and what you are trying to achieve https://developers.facebook.com/docs/reference/ios/3.5/class/FBProfilePictureView – Vig Nov 21 '14 at 13:30

1 Answers1

0

The problem is that FBProfilePictureView contains a UIImageView and does not expose it for you to modify it's properties.

It downloads a square image if pictureCropping == FBProfilePictureCroppingSquare otherwise it downloads a small, medium or large image depending on the width of the frame. But there is no way to control how this image is scaled to fill the FBProfilePictureView.

I created a replacement view which exposes the UIImageView through a read-only imageView property and therefore allows you to control its contentMode.

combinatorial
  • 9,132
  • 4
  • 40
  • 58