UIImageView Placement (IPhone)

Discussion in 'Mac Programming' started by springframework, Apr 2, 2008.

  1. macrumors member

    Mar 31, 2008
    I am using this code to place an image but it doesn't seem to work. The image just gets shown at 0,0

    UIImage *image = [UIImage imageNamed:@"image.png"];
    CGPoint imagepoint CGPointMake(272,0);
    image drawAtPoint:imagepoint];
    UIImageView *imageview = [[UIImageView allocinitWithImage:(UIImage *)image];
    window addSubView:imageview];
    from the class documentation this seems to be the proper way to do things.

    what am I doing wrong?
  2. thread starter macrumors member

    Mar 31, 2008
    thank you, i added this lines in and took out the [image:drawAtPoint] stuff

    CGRect imageframe CGRectMake(100,0,44,600);
    UIImageView *imageview = [[UIImageViewinitWithFrame:imageframe];
    imageview.image image;
    it works now

Share This Page