Display one view at different places!!
Hi guys...
I need help by displaying an UIImageView at different places...
I made a UIImageView in the Interface Builder..but how can i add this imageView at the same time in every corner of my view? I can only display it in one corner...
I tried it without interface builder..
-(IBAction)action1 {
CGRect dragRect = CGRectMake(0.0f, 0.0f, 64.0, 64.0);
dragRect.origin = CGPointMake(300, 300);
UIImageView *image = [[UIImageView alloc] initWithFrame:dragRect];
[image setImage:[UIImage imageNamed:@"Apple.png"]];
[super.view addSubview:image];
}
and now i can change my CGPointMake and i can display my image multiple at the same time... but how can i remove all images at once?
-(IBAction)action2 {
CGRect dragRect = CGRectMake(0.0f, 0.0f, 64.0, 64.0);
dragRect.origin = CGPointMake(300, 300);
UIImageView *image = [[UIImageView alloc] initWithFrame:dragRect];
[image setImage:[UIImage imageNamed:@"Apple.png"]];
[image removeFromSuperview];
}
i thought this should work.. but no it doesnt work...
Can anybody help me?
thank you a lot
greez Franhu
|