UIImageView don't show image

Discussion in 'iOS Programming' started by nightwar00, Jun 15, 2009.

  1. nightwar00 macrumors newbie

    Joined:
    Jun 14, 2009
    #1
    hi there.
    I have a little problem with an UIImageView.
    I have improve my SDK to version 3.0 (before 2.2) and the UIImageView don't want to show the image i load :

    Code:
    menuImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"menuImage.png"]];
    		[self addSubview:menuImage];
    I don't understand why.... is something wrong with the new SDK?
    please help
     
  2. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    Make sure the frame on the UIImageView is what you want. I'm not sure if that method sets the frame size, but most likely the frame origin is not where you want it.
     
  3. nightwar00 thread starter macrumors newbie

    Joined:
    Jun 14, 2009
    #3
    thanks for answer.
    I put this code and it doesn't work ...
    Code:
    menuView.frame = CGRectMake(0, 0, 200, 200);
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    Are you sure the UIImage is correctly initialising? Can you split the UIImage creation into it's own statement and check that it's not nil?
     
  5. nightwar00 thread starter macrumors newbie

    Joined:
    Jun 14, 2009
    #5
    I have print the value of menuView pointer and i found "0" before initialing and "19580" after so the pointer is correctly initialing..... I don't understand ....
    With other project (apple project) the image are correctly display.... Am i missing one line of code ?

    i don't understand, in addition my prject display image with sdk 2.2... when i moved to 3.0 the image doesn't display .

    any help?
     

Share This Page