0

I'm trying to get the UIImage from ProfilePictureView given in facebook sdk. the code displays the picture when i extracted the UIImageView and added to the main view controller. but when I try to get the UIImage out from the UIImageView I instantiated, then it gives me the default profile picture of facebook. Please help!

public override void ViewDidLoad ()
{
base.ViewDidLoad ();

// txt_fname.Text = _user.First_Name;
// txt_lname.Text = _user.Last_Name;
UIImageView y = new UIImageView();
UIImage image = new UIImage ();
// btn_photo.SetBackgroundImage (fb_profile, UIControlState.Normal);

    foreach (var x in fb_profile.Subviews) {
        if (x is UIImageView) {
            y = (UIImageView)x;

            btn_photo.SetBackgroundImage (y.Image, UIControlState.Normal);

        }
    }
View.AddSubview (y);

enter image description here

CoderKK
  • 351
  • 1
  • 7
  • 18
  • How many UIImageView objects are there is subviews? I would guess more than one and the last one happens to hold the default profile picture. Why not grab the image directly... graph.facebook.com//picture – combinatorial Apr 27 '15 at 03:19
  • @combinatorial I put a breakpoint in to check how many UIImageViews are there. it only iterates once. therefore, guess there is only one of them. I certainly can do that. but I was wondering why this is happening. – CoderKK Apr 27 '15 at 04:51

0 Answers0