views:

32

answers:

2

Hi,

I want to create an UIImageView with, for example, "Trend.jgp" for a special case (if-condition). I Tried various ways with CGRectMake but i'm not able to create this picture dynamically to a special place. Furthermore, i can't use the function setimage like it's described in the Developer Documentation.

Has anyone got an idea how to realise my plan?

Thanks a lot,

Jonathan

A: 
UIImageView *imageView = nil;
if (specialCase) {
  imageView = [[UIImageView alloc] initWithImage: [UIImage imageNamed: @"Trend.jpg"]];
} else {
  //whatever you want to do in the other case
}
Graham Lee
A: 
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Trend"]];
imageView.frame = CGRectMake(....) or  imageView.center = CGPointMake(...)

Add this view to your container view, i.e. [myView addSubview:imageView];

Eiko
thank you very much! my plan works now!
Jonathan