UIImageView don't show image

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

  1. nightwar00 macrumors newbie

    Jun 14, 2009
    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 :

    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


    Jun 15, 2000
    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

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


    Jul 24, 2002
    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

    Jun 14, 2009
    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